Saturday, 17 August 2013

Having problems with RewriteRule and .htaccess

Having problems with RewriteRule and .htaccess

I'm having a problem with my .htaccess. This is the code:
RewriteEngine On
Options -MultiViews
Options +FollowSymlinks
#Remove .php extension
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
#Profile
RewriteRule ^profile/([a-zA-Z0-9_-]+)-([0-9]+)/([a-zA-Z0-9_-]+)$
profile.php?one=$1&two=$2&three=$3
I want to remove the .php extension, and create a seo-friendly URL with
/profile.php. The problem comes when I try to access to
http://website.com/profile/1/2/3, I get 500 Error. But if I remove the
code which removes php extension, then, it works well, but of course, the
.php extension is showed.
So... what's wrong in this code? I checked over and over and I really
don't find any bugs... thanks.

No comments:

Post a Comment