httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Williard" <jwilli...@pcsafe.com>
Subject [users@httpd] Rewrite/RedirectMatch Issues
Date Fri, 03 Feb 2006 08:27:02 GMT
I have been having trouble getting some Rewrites or Redirects to work.  Here
is what I am trying to do:

http://weather.domain.com/ -> http://www.domain.com/weather/
http://weather.domain.com/##### -> http://www.domain.com/weather/#####
http://weather.domain.com/@@@@@ -> http://www.domain.com/weather/@@@@@

The ##### represents a string of 5 digits (US zip code).  The @@@@@ string
represents any text (aimed at the name of a city).

Here is what I currently have.  I've gone through many changes, but this
seems to be the closest to working properly:

  Redirect        /index.php      http://www.domain.com/weather/
  RedirectMatch   ^/([0-9]{5})    http://www.domain.com/weather/$1
  RedirectMatch   ^/([A-Za-z]+)   http://www.domain.com/weather/$1


The problem with this is the last line is interpreting "index.php" as
"/index" and appending that to the end.  The second line works perfectly.
How can I get the last line to work without seeing index.php, or index, as a
match?


Also, when it gets to http://www.domain.com/weather/$1, I am experiencing a
similar issue.  The images/ folder is in a folder called weather/.  So, with
the rules that I have in place, the images are not showing up.  I'd like to
know if there is a way to follow the rules while excluding the weather
folder.

Here are the rules for that:

RewriteRule  ^weather/$
cgi-bin/weather/hw3.cgi?forecast=asus01&use_map=us_c_sm_albers2 [NC]
RewriteRule  ^weather/([0-9]{5})    cgi-bin/weather/hw3.cgi?pands=$1
[NC]
RewriteRule  ^weather/([A-Za-z]+)   cgi-bin/weather/hw3.cgi?pands=$1
[NC]


----
Thank You,
Jason Williard



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