Page 1 of 1

more apache mod rewrite help

Posted: Sat Oct 22, 2005 1:54 pm
by s.dot
I have the following two rewrite rules

Code: Select all

RewriteRule ^photos/([a-zA-Z0-9_-]+)(/)?$ /albums.php?u=$1
RewriteRule ^photos/([a-zA-Z0-9_-]+)/([0-9]+)(/)?$ /albums.php?u=$1&aid=$2
When someone goes to photos/user it works good.
But when they go to photos/user/1234 the page rewrites to photos/user and ignores the numbers.

What am I doing wrong?

Posted: Sat Oct 22, 2005 2:32 pm
by shoebappa
Try putting something like:

Code: Select all

RewriteRule ^photos/([a-zA-Z0-9_-]+)/([0-9]+)(/)?$ /albums.php?u=$1&aid=$2 [P,L]
RewriteRule ^photos/([a-zA-Z0-9_-]+)(/)?$ /albums.php?u=$1 [P,L]
I know the L would make it the last one, but I usually use P for Proxy, but that might not be necessary, I don't know.

Posted: Sat Oct 22, 2005 3:18 pm
by s.dot
Nope, I didn't have any luck with that. Thanks, though. :)

It did however, get me looking at the apache documentation for it. And I think the chain ([C]) flag is what I'm looking for. I could be wrong though. :-/

I played around with it and didn't have any luck.