AW: [users@httpd] Troubles w/mod_rewrite

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



use a RewriteCond before your weather.pl line
and change the [R] into [R,L] 
see http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#RewriteCond


bye 
Oliver


Freundliche Gruesse / Best Regards / Avec mes meilleures salutations

Oliver Schaudt
SeniorConsultant
Tel:: +49-178-8855-712
Fax: +49-178-998855-712
mailto:oliver.schaudt@xxxxxxxxx

Unilog Avinci
Klenzestr. 57b
D-80469 München

http://www.unilog-avinci.de 



-----Ursprüngliche Nachricht-----
Von: jslive@xxxxxxxxx im Auftrag von Joshua Slive
Gesendet: Fr 20.01.2006 00:29
An: users@xxxxxxxxxxxxxxxx
Betreff: Re: [users@httpd] Troubles w/mod_rewrite
 
On 1/19/06, Jason Williard <jwilliard@xxxxxxxxxx> wrote:
>
> You were right... As soon as I removed the leading slash, the problem was
> solved.  But now I have another issue...
>
> While I want this rewrite to occur, I also want everything else to redirect
> to a default URL.  To do this, I added the following:
>
> RewriteRule     ^([0-9]{5})   http://.../weather.pl?zip=$1 [R]
> RewriteRule     ^(.*)         http://.../DEFAULT [R]
>
> The first of these rules intended to rewrite only if a 5 number zip exists.
> The second to redirect everything else.  Unfortunately, that much of a
> wildcard also seems to grap 5-digit zips as well.  I'm sure this is simply a
> regex thing, which I'm not that great at.  How would I get it to redirect
> everything except for the 5-digit zip?

The easy way would simply be to add the "L" flag to the first
RewriteRule (use [R,L]).  This should stop processing at that point
for matching requests.  Otherwise, you can add something like this
before the second RewriteRule:
RewriteCond %{REQUEST_URI} ^/[0-9]{5}$

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


<<winmail.dat>>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux