This is a discussion on mod_rewrite example? within the Apache Web Server forums, part of the Web Server and Related Forums category; I've been looking through the mod_rewrite info from here: http://httpd.apache.org/docs/2.2/mod...ml#rewriterule ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I've been looking through the mod_rewrite info from here:
http://httpd.apache.org/docs/2.2/mod...ml#rewriterule I still dont understand how to make something like the following: www.blah.com/aaa/bbb/ccc.xxx Get rewritten to say: www.blah.com/aaa/bbb/script.php?page=ccc.xxx Could anyone who knows mod_rewrite please give the line needed for the mod_rewrite to do that so I can take a look at it? Thanks for reading the post :¬) |
|
|||
|
"Davide Bianchi" <davideyeahsure@onlyforfun.net> wrote in message
news:slrnfp3a55.34j.davideyeahsure@fogg.onlyforfun .net... > On 2008-01-19, Trammel <Me@Server.com> wrote: >> www.blah.com/aaa/bbb/ccc.xxx >> >> Get rewritten to say: >> www.blah.com/aaa/bbb/script.php?page=ccc.xxx > > *UNTESTED* > > RewriteCond %{REQUEST_URI} /aaa/bbb/.*$ > RewriteRule ^/aaa/bbb/(.*)$ /aaa/bbb/script.php?page=$1 > > Davide Thanks. This helps ALOT. Quick question though: I noticed there is no ^ in the RewriteCond... was there a certain reason that Im not aware of - or is it just because its not really needed? |
|
|||
|
Davide Bianchi wrote:
> On 2008-01-19, Trammel <Me@Server.com> wrote: >> www.blah.com/aaa/bbb/ccc.xxx >> >> Get rewritten to say: >> www.blah.com/aaa/bbb/script.php?page=ccc.xxx > > *UNTESTED* > > RewriteCond %{REQUEST_URI} /aaa/bbb/.*$ > RewriteRule ^/aaa/bbb/(.*)$ /aaa/bbb/script.php?page=$1 > Ok. It's late and I just finished dealing with a database server that didn't want to serve. I don't understand what the RewriteCond above adds to the RewriteRule. From looking at rewrite logs over the past few years, it appears to me that the Rule is evaluated and if it matches, any conditions are then evaluated to determine if the rule should be applied. What does the condition above add to the process? Jim |
|
|||
|
"Davide Bianchi" <davideyeahsure@onlyforfun.net> schreef in bericht
news:slrnfp5tk1.34p.davideyeahsure@fogg.onlyforfun .net... > On 2008-01-20, Jim Hayter <see.reply.to@nowhere.invalid> wrote: >> I don't understand what the RewriteCond above adds to the RewriteRule. >> From looking at rewrite logs over the past few years, it appears to me >> that the Rule is evaluated and if it matches, any conditions are then >> evaluated to determine if the rule should be applied. What does the >> condition above add to the process? > > It is my understanding that the condition is checked first, and if > it does not match the rule is not even looked at, but I could be wrong. > http://httpd.apache.org/docs/2.2/rew...nternalRuleset rules are evaluated first then the conditions in listed order. Anyway, doing the same thing boht in a rule and again in a condition-when matching- is a waste. Hans |
| Thread Tools | |
| Display Modes | |
|
|