Advertisement
AVONnadozie

Append .php to URLs

Dec 8th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <IfModule mod_rewrite.c>
  2.     <IfModule mod_negotiation.c>
  3.         Options -MultiViews
  4.     </IfModule>
  5.  
  6.     #Turn on rewrite engine if available
  7.     RewriteEngine On
  8.  
  9.     #We then rewrite URIs that does not end with .php and
  10.     #do not point to existing files to their .php version
  11.     RewriteCond %{REQUEST_URI} !^.*\.php
  12.     RewriteCond %{REQUEST_FILENAME} !-f
  13.     RewriteCond %{REQUEST_FILENAME} !-d
  14.     RewriteRule ^(.*)$ $1.php [L]
  15.  
  16. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement