Reputation: 185
This is where the PHP files are:
ts1.WEBSITENAMEHERE.biz/cp/
The .htaccess file is also in this folder. I want to remove the '.php' from 'FILENAME.PHP'.
This is my current '.htaccess' file:
Options +FollowSymlinks
RewriteEngine on
RewriteBase /cp
RewriteRule ^(.*)/$ $1.php
But it is not working. Why is this?
Upvotes: 1
Views: 2511
Reputation: 12592
Options +FollowSymlinks
RewriteEngine on
RewriteBase /cp
RewriteRule ^(.*) $1.php
I use this checker: http://htaccess.madewithlove.be
Upvotes: -1
Reputation: 3458
Create a .htaccess file in the DocumentRoot dir. Add the following code in that file...
##############
RewriteEngine On
RewriteCond %{REQUEST_URI} !^(.*)\.(.*)$
RewriteRule ^(.*)$ %{REQUEST_URI}.php [R]
#############
mod_rewrite should be enabled for this to work.
Upvotes: 0
Reputation: 255005
RewriteEngine on
RewriteBase /cp/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !\.php$
RewriteRule .* $0.php [L]
Upvotes: 3