Ricky55 Posted January 20, 2010 Share Posted January 20, 2010 Hi Just started to use PHP and I've just uploaded a site that uses some simple includes. I want to remove the PHP extension from my URL / Links as I think they just look better without them. Just looked up how to do it with a .htaccess file and the code I've seen works except on one file. It works for all my files that are all in the root folder of the site, one file though products.php when you click the link the browser adds a / on to the end of the URL. When I've look at the permissions they are different for products.php then they are for all my other files. I've not changed these myself, the only difference between products.php and the others is that products links to other php files where the other files link to other files but through an include. All the files that work have the following permissions Owner 6645 Group 48 Octal 644 Products.php has octal 644 but the owner and group are blank. I've tried to change the permissions using Transmit FTP and I just get the following error: Unknown SITE command. The code in the htaccess file is RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php What am I doing wrong? / how do I get around this? Thanks in advance Ricky Quote Link to comment https://forums.phpfreaks.com/topic/189235-removing-php-extension-with-htaccess/ Share on other sites More sharing options...
cags Posted January 22, 2010 Share Posted January 22, 2010 The easiest method would probably be to place the files in folders and set the file as the DocumentIndex (or rename them all to index.php). Quote Link to comment https://forums.phpfreaks.com/topic/189235-removing-php-extension-with-htaccess/#findComment-999907 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.