Boopathi Rajan
Boopathi Rajan

Reputation: 1210

how to hide .php extension from url?

I am New in Php Development. Any error in the following code..

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Its not working in my web site.

Upvotes: 0

Views: 2462

Answers (1)

RaGu
RaGu

Reputation: 693

RewriteEngine On

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ $1\.php

and put your htaccess file in the parent directory.

Upvotes: 2

Related Questions