Welcome to WebmasterWorld Guest from 3.227.2.109

Forum Moderators: Ocean10000 & phranque

Message Too Old, No Replies

search engine frieldly URLs

RewriteRule twice wont work

     
11:25 am on Sep 19, 2003 (gmt 0)

New User

10+ Year Member

joined:Sept 19, 2003
posts:7
votes: 0


Hello!
I have a problem! I want this to work (in the .htaccess file):

RewriteRule (.*)/(.*)\.html$ /album\.php?album=$1&show=$2
RewriteRule (.*)/(.*)\.html$ /album\.php?album=$1&nbpage=$2

but it doesn't. If I disable one of them, the other one works, but I want them BOTH to work at the same time. How can I do that?

Please help me!

/Helen

11:33 am on Sept 19, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 22, 2003
posts:1023
votes: 0


Hi archker,

Am no mod_rewrite expert, but this might work, placing [NE,L] after the first rule. If that don't work, Jim Morgan will be able to answer this one I am sure.

RewriteRule (.*)/(.*)\.html$ /album\.php?album=$1&show=$2 [NE,L]
RewriteRule (.*)/(.*)\.html$ /album\.php?album=$1&nbpage=$2

See message two [webmasterworld.com] for further explanation.

-gs

11:50 am on Sept 19, 2003 (gmt 0)

New User

10+ Year Member

joined:Sept 19, 2003
posts:7
votes: 0


too bad, didn't work... I'm going to try and read that other thread as well.
3:48 pm on Sept 19, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


Helen,

What do you mean when you say you want these BOTH to work?

Since the patterns are the same, whichever rule you place first will always rewrite a request for <something>/<something>.html to /album.php and add on the query string. Then the second rule will never match, because the URL has been changed to /album.php, and therefore won't match a pattern with ".html" in it.

It might be simpler if you state the overall goal along with the implementation problem. Some detail appears to be missing.

Jim