httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jos...@slive.ca>
Subject Re: [users@httpd] Troubles w/mod_rewrite
Date Thu, 19 Jan 2006 21:02:18 GMT
On 1/19/06, Jason Williard <jwilliard@pcsafe.com> 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@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message