Hi
I'm trying to write a simple rewrite rule that would take any of the following :
http://www.my-domain.com/191/foo/bar/blah http://my-domain.com/191/foo/bar/ http://www.my-domain.com/191/foo/bar/blah/foo/bar/blah
and rewrite it to
http://www.my-domain.com/index.php?pid=191
Everything I've tried always gets all of the "191/foo/bar/blah" whereas I would like it to stop at the first slash after the id number
I'm sure there must be a simple way to do this but I can't find it !!
can you help ?
Sounds like the RewriteRule regexp you'd want is:
^([0-9]+)(/.*)+$
it works! brilliant! that has vastly simplified my htaccess file and lets me put anything I want after the page id number - woohoo! many thanks
steamPunk;11023091 wrote: lets me put anything I want after the page id number
lets me put anything I want after the page id number
... which begs the question, why do you need to put anything after the ID number if all you need is the number? :p