Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

search engine frieldly URLs

RewriteRule twice wont work



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

10+ Year Member

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!


Alternative Future

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

WebmasterWorld Senior Member 10+ Year Member

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.



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

10+ Year Member

too bad, didn't work... I'm going to try and read that other thread as well.


3:48 pm on Sep 19, 2003 (gmt 0)

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


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.



Featured Threads

Hot Threads This Week

Hot Threads This Month