RanDeh
09-02-2011, 02:32 AM
Hi Everyone,
I am trying my hand at a mod_rewrite, although I keep getting a 404 error and from the url if it did work I would not get the results I am looking for. I want to drop the articledetail.php only and keep everything else or is this just impossible. I am hopeful someone here can help me out.
Thanks,
This what I get with the 404 error:
http://www.articlefinder.info/793/90/Exercise/Algonquin-IL-Personal-Fitness-Trainers-Train-With-the-Best.html
This is what I want:
http://www.articlefinder.info/artid=793&catid=90&title=Algonquin-IL-Personal-Fitness-Trainers---Train-With-the-Best.html
RewriteEngine on
# Mod Rewrite
Options +FollowSymLinks
#Fix Rewrite
Options -Multiviews
Rewritebase /
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{THE_REQUEST} ^[^/]*/articledetail\.php [NC]
RewriteRule ^articledetail\.php(.+) $1 [R,L]
#Rewrite Rules and conditions below were already in the script and work.
RewriteCond %{REQUEST_METHOD} ^PUT$ [OR]
RewriteCond %{REQUEST_METHOD} ^MOVE$
RewriteRule ^/author/(.*)\.php /author/$1.nophp
RewriteRule ^/author/(.*)\.html /author/$1.nohtml
RewriteRule ^/author/(.*)\.htm /author/$1.nohtm
RewriteRule ^/author/(.*)\.js /author/$1.nojs
I am trying my hand at a mod_rewrite, although I keep getting a 404 error and from the url if it did work I would not get the results I am looking for. I want to drop the articledetail.php only and keep everything else or is this just impossible. I am hopeful someone here can help me out.
Thanks,
This what I get with the 404 error:
http://www.articlefinder.info/793/90/Exercise/Algonquin-IL-Personal-Fitness-Trainers-Train-With-the-Best.html
This is what I want:
http://www.articlefinder.info/artid=793&catid=90&title=Algonquin-IL-Personal-Fitness-Trainers---Train-With-the-Best.html
RewriteEngine on
# Mod Rewrite
Options +FollowSymLinks
#Fix Rewrite
Options -Multiviews
Rewritebase /
RewriteRule ^\.htaccess$ - [F]
RewriteCond %{THE_REQUEST} ^[^/]*/articledetail\.php [NC]
RewriteRule ^articledetail\.php(.+) $1 [R,L]
#Rewrite Rules and conditions below were already in the script and work.
RewriteCond %{REQUEST_METHOD} ^PUT$ [OR]
RewriteCond %{REQUEST_METHOD} ^MOVE$
RewriteRule ^/author/(.*)\.php /author/$1.nophp
RewriteRule ^/author/(.*)\.html /author/$1.nohtml
RewriteRule ^/author/(.*)\.htm /author/$1.nohtm
RewriteRule ^/author/(.*)\.js /author/$1.nojs