How to hide .html, .htm or .php extension at URL

  1. Create .htaccess file in the root directory of your web.
  2. Write into the file:
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^([^\.]+)$ $1.html [NC,L] - FOR HTML ONLY
    RewriteRule ^([^\.]+)$ $1.php [NC,L] - FOR PHP ONLY
  3. Save the file.
  4. Adjust all hyperlinks on your website – delete all html (htm) and php extensions.
  5. Done.

Napsat komentář

Vaše e-mailová adresa nebude zveřejněna.