Answers for "htaccess hide php and html extention"

PHP
1

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/)
Posted by: Guest on June-28-2021
0

how to hide .php extension using .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Posted by: Guest on March-13-2021

Code answers related to "htaccess hide php and html extention"

Browse Popular Code Answers by Language