homepage Welcome to WebmasterWorld Guest from 54.161.214.221
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
search engine frieldly URLs
RewriteRule twice wont work
archker




msg:1509958
 11:25 am on Sep 19, 2003 (gmt 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

 

Alternative Future




msg:1509959
 11:33 am on Sep 19, 2003 (gmt 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

archker




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

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

jdMorgan




msg:1509961
 3:48 pm on Sep 19, 2003 (gmt 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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved