more apache mod rewrite help

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

more apache mod rewrite help

Post 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?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
shoebappa
Forum Contributor
Posts: 158
Joined: Mon Jul 11, 2005 9:14 pm
Location: Norfolk, VA

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post 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.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply