0

I have created a php web site. Here I have implemented the clean URL in .htaccess file. I need to display mu link mydomain/index.php to mydomain/index

So I have used

RewriteRule index index.php

But I have lot of files. So how will I write a common rule for this entire page?

E:g

RewriteRule hotels hotels.php

Thanks

user1263260
  • 243
  • 3
  • 6
  • 17

1 Answers1

1

try this:

#Setup
Options +FollowSymLinks
RewriteEngine On

#Remove trailing slashes
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ /$1 [R=permanent,QSA]

#Your thing
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
Adi
  • 5,089
  • 6
  • 33
  • 47