Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

hide php extension htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.php
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

#This works with xxx/index.php too (visiting mysite.com/xxx/)
 
PREVIOUS NEXT
Tagged: #hide #php #extension #htaccess
ADD COMMENT
Topic
Name
2+7 =