Hide file extensions with htaccess


/ Published in: Apache
Save to your folder(s)



Copy this code and paste it in your HTML
  1. RewriteCond %{REQUEST_FILENAME} !-d
  2. RewriteCond %{REQUEST_FILENAME}\.php -f
  3. RewriteRule ^(.*)$ $1.php
  4.  
  5. RewriteCond %{REQUEST_FILENAME} !-d
  6. RewriteCond %{REQUEST_FILENAME}\.html-f
  7. RewriteRule ^(.*)$ $1.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.