Rewrite parameters not matching...

New to mod_rewrite? This is a good place to start.

Rewrite parameters not matching...

Postby tbg130 » Mon Apr 11, 2005 2:58 pm

Hi,

I have some confusion here and could use some help; new to this stuff.

I have a site that I want to build with SQL and ASP. The URLs will be as follows (for example):

http://www.mysite.com/info.asp?cat=cities&cityid=ottawa
http://www.mysite.com/info.asp?cat=beac ... id=florida

I desire the following:

http://www.mysite.com/cities/ottawa.html
http://www.mysite.com/beaches/florida.html

The problem is that my Rewrites are matching on the first case so it is returning the beachid variable instead of the cityid variable since the City Rewrite is before the Beach Rewrite...

RewriteCond Host: www\.mysite\.com
RewriteRule /([^/]+)(?:/([^/]+))\.html /info.asp\?cat=$1(?2&beachid=$2) [I,L]

RewriteCond Host: www\.mysite\.com/info.asp\?cat=cities
RewriteRule /([^/]+)(?:/([^/]+))\.html /info.asp\?cat=$1(?2&cityid=$2) [I,L]

I'd also eventually like to have the following:

http://www.mysite.com/florida/beaches/beachname.html

How would I achieve that???

Any help or suggestions would be much appreciated; this problem will get bigger as I get some things going on the site (early stages) and will have tours, restaurants, etc. In other words, many categories (cat), many id's, and many sub id's...

Thanks for your help in advance!
tbg130
 
Posts: 2
Joined: Sat Apr 09, 2005 12:53 pm

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 10 guests

cron