Hi, I am trying to remove .php extension from the URLs on my site. The .htaccess file I am using works on localhost, but when I upload it to server, it doesn't work. Server has PHP4 and PHP5 but the default is PHP4, therefore I am using an extra line of code to make PHP5 the default handler. Here is the .htaccess file: AddHandler x-httpd-php5 .php RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] Code (markup): Am I doing something wrong?
ive tried your code to my localhost, hmm.. it doesnt work.. different behavior, it is downloading the script and opening to other format. heres the one i use..
This is the one I use on the server. I remove "AddHandler x-httpd-php5 .php" on localhost, because I already have PHP5 on localhost. I guess the one you are using changes one single page.
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) index.php?page=$1&pag=$2 [QSA,NC,L] This is what i use in my htaccess, and the urls i made them with request_uri. It`s more easier, and you can control all your link extentions.