Help with Rewriting rule

Topics: Developer Forum, User Forum
Jan 4, 2010 at 2:48 PM

Hi All!

I'm a total Regular Expression noob and after reading about every single word in the documentation of IIRF and on the Regular Expression Wikipedia page, I still don't get it..
What I'm trying to accomplish is this:

Current situation:
Website with pages like:    .. All pages have this very same form ("index.asp?action=" is always the same and always present.. only thing that differs is the code behind the action var)... - except for a few other pages that do not need to be rewritten.

What I would like to accomplish is this: rewrite to .. (except for pages like .. they do not need to be rewritten)..

How do I accomplish this???? It beats me..........!

Thanks in advance!!!!




Jan 4, 2010 at 8:13 PM

It should be pretty simple.

# rewrite URLs that consist only of digits
RewriteRule  ^/(\d+)$   /indexp.asp?action=$1  [L]