Link to home
Create AccountLog in
Avatar of coolispaul
coolispaulFlag for United States of America

asked on

using rewrite in htacess

Hi,

i am trying to use htaccess to rewrite the URLS on my site.
For example, i have:
http://www.perfectgolfholidays.com/region.php?country_id=1®ion_id=1

i want it to read the appropriate names of regions/countries

in this case it would be:
http://www.perfectgolfholidays.com/spain/costa-del-sol

I was told i could use RewriteMap  but this causes a server error.

Could anyone help me accomplish this?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of coolispaul

ASKER

ah ok but what happens when the region changes - i.e.

http://www.perfectgolfholidays.com/spain/murcia
Given a url with the following "pattern":
http://www.perfectgolfholidays.com/XXX/YYY

it should do an "internal redirection" to /region.php?country=XXX&region=YYY

regardless of what value you actually use/substitute for XXX and YYY.

In case it's not clear, by "internal redirection" I mean that the users browser will still display:
http://www.perfectgolfholidays.com/XXX/YYY

even though the server is actually executing:
http://www.perfectgolfholidays.com/region.php?country=XXX®ion=YYY