how to make this url(https://justinsimdev.com/about-us.html)become this url(https://justinsimdev.com/about-us)
basically just remove the .html from the link.
anyone can help me solved this problem.
I'm a self-taught web developer.
how to make this url(https://justinsimdev.com/about-us.html)become this url(https://justinsimdev.com/about-us)
basically just remove the .html from the link.
anyone can help me solved this problem.
I'm a self-taught web developer.
To remove the .html extension from your urls, you can use the following code in root/htaccess :
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
NOTE: If you want to remove any other extension, for example to remove the .php extension, just replace the html everywhere with php in the code above.
Also see this How to remove .html and .php from URLs using htaccess`. https://helponnet.com/2020/02/04/remove-html-and-php-extension-with-htaccess-rewriterule-url-rewriting-tips/