RE: [users@httpd] Troubles w/mod_rewrite

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

 



A few things (I'm still kind of new to some of this myself).

Check the syntax [PT,QSA] vs [P,L,QSA]

Do you want to proxy the request immediately or let the next handler
process the request?

Do you need to pass the query string to the url or just the zip?

Do turn on the rewrite log and check to see if you are getting what you
want.

Hope this helps!

Frank

-----Original Message-----
From: Jason Williard [mailto:jwilliard@xxxxxxxxxx] 
Sent: Thursday, January 19, 2006 4:31 PM
To: users@xxxxxxxxxxxxxxxx
Subject: RE: [users@httpd] Troubles w/mod_rewrite

I added the RewriteLog directive to the .htaccess file and am now
getting
Internal Error messages.  When looking at the error logs, I get:

[Thu Jan 19 13:20:08 2006] [alert] [client x.x.x.x]
/www/vhosts/domain.com/weather/.htaccess: RewriteLog not allowed here

The entry in the .htaccess file looks like:
RewriteLog     "logs/rewrite.log"


Any ideas why this may be happening?
 
----
Thank You,
Jason Williard



On 1/19/06, Jason Williard <jwilliard@xxxxxxxxxx> wrote:
> I have a site that shows weather forecasts.  I would like create a
> RewriteRule to redirect to the proper URL when someone appends their
zipcode
> to the base url.
>
> i.e. http://weather.domain.com/12345 ->
> http://www.domain.com/cgi-bin/weather/weather.pl?zip=12345
>
> So far, I have tried several methods but cannot get it to work.  Here
are
my
> current rules in the .htaccess file:
>
> RewriteEngine   On
> RewriteRule     ^/([^/]*)
> http://www.domain.com/cgi-bin/weather/weather.pl?zip=$1 [PT,QSA]
>
> I have also tried each of the following:
>
> RewriteRule     ^/([^/][0-9])
> http://www.searching.com/cgi-bin/weather/weather.pl?zip=$1 [PT,QSA]
> RewriteRule     ^/([^/][0-9]{5})
> http://www.searching.com/cgi-bin/weather/weather.pl?zip=$1 [PT,QSA]
> RewriteRule     ^/([0-9]{5})
> http://www.searching.com/cgi-bin/weather/weather.pl?zip=$1 [PT,QSA]
> RewriteRule     ^/([0-9])
> http://www.searching.com/cgi-bin/weather/weather.pl?zip=$1 [PT,QSA]
>
> None of these have worked.  I simply get a 404 Not Found error.
However,
I
> know that mod_rewrite is working as I had another rule in place for
> redirecting anything that goes to that page to the default URL.
>
> Any ideas?

Use the RewriteLog to see what mod_rewrite is doing.

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


---------------------------------------------------------------------
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


---------------------------------------------------------------------
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