Mod_Rewrite Help Wanted, Apply Within
March 2, 2007 9:27 AM
Subscribe
I am in mod_rewrite hell. What a syntax! Can someone smarter than me have a look and tell me I'm not crazy? Thanks!
Okay, mod_rewrite is working and respecting my .htaccess file, so there's no installation problem. I wish to shorten URLs in this form:
www.mysite.com/dynamicpages/newstory.shtml?shownews.tmpt&showstory=122
To something like this:
www.mysite.com/news?122
So that users can type the latter and get the same results they would get from the "expanded" first version.
I know this is exactly what mod_rewrite is for, but for the life of me I can't get it to produce anything other than nasty looping errors like "Too many redirects."
Can someone demonstrate the no-doubt three-liner I need? Thanks.
posted by rokusan to computers & internet (8 comments total)
2 users marked this as a favorite
RewriteRule ^news\?(+[0-9])$ /newstory.shtml?shownews.tmpt&showstory=$1 [L]
I'm probably wrong though. :)
posted by afx114 at 9:36 AM on March 2, 2007