Reputation: 11746
Using the answer I received from rcs20 in my previous post when I add this entry to my .htaccess file I see the error 404 Not Found:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^member\-([0-9]+)\-([^/])\.htm(l)?$ view_profile.php?id=$1 [NC,L]
The URL I'm passing it is:
mysite/member-8222-jane.html
Any idea why this might be happening. My old rewrite rule works fine:
RewriteRule view_profile=(.*)$ view_profile.php?id=$1
Upvotes: 3
Views: 221
Reputation: 605
found it:
The +
sign needs to be added to [^/]
=> ([^/]+)
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^member\-([0-9]+)\-([^/]+)\.htm(l)?$ view_profile.php?id=$1 [NC,L]
You can also add the extra chars jane
in member-8222-jaane.html
by using the $2 like:
RewriteRule ^member\-([0-9]+)\-([^/]+)\.htm(l)?$ view_profile.php?id=$1&extra=$2 [NC,L]
Upvotes: 7