meme meme - 1 year ago 100
Apache Configuration Question

How do I configure routing in Apache?

How do I hide my .html files for example when I go to it redirects to but it hides the /\index.html so it stays as but is actually .
I don't really know how to explain but if you understand me can you please help, thanks.

Answer Source

Please write below code in your .htaccess file.

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} \.html$
RewriteRule ^(.*)\.html$ $1 [R=301,L]

The .html will be removed from your URL using above code. Lets say your contact us page URL is so using above code it will be instead.