how to do this

Discuss practical ways rearrange URLs using mod_rewrite.

how to do this

Postby sarahbaran » Mon Sep 01, 2008 11:42 pm

hi all,
i'm new with M_D,
i have this url:
http://mydomain.com/detail.php?Nref=ES9 ... ject=Benicàssim&RegionName=Costa%20del%20Azahar&RefPicture=http://web.provider.com/ImagesIps/Normal/ES/ES9655.220a_s.jpg&OccupantsAdt=2&OccupantsChd=1&fldEdad1=1&fldEdad2=&fldEdad3=&Rooms=3&CheckIn=2008-09-06&CheckOut=2008-09-13&fldDias=7&Price=522
how can i change that for something like this:
3 of the vars of url are:
Nref=ES9655.220.1
CountryName=Spain
RegionName=Costa%20del%20Azahar

http://mydomain.com/Spain/CostadelAzahar/ES9655.220.1
i mean:
http://mydomain.com/CountryName/RegionName/Nref
NRef without % symbols
thanks a lot
sarahbaran
 
Posts: 2
Joined: Mon Sep 01, 2008 11:16 pm

Postby richardk » Tue Sep 02, 2008 11:54 am

Do any of the other parameters change? Mod_rewrite can't fill in the missing parameters.

Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/([a-z0-9\.]+)/?$ /detail.php?CountryName=$1&RegionName=$2&Nref=$3&LanguageCode=es&PlaceObject=Benicàssim&RefPicture=http://web.provider.com/ImagesIps/Normal/ES/ES9655.220a_s.jpg&OccupantsAdt=2&OccupantsChd=1&fldEdad1=1&fldEdad2=&fldEdad3=&Rooms=3&CheckIn=2008-09-06&CheckOut=2008-09-13&fldDias=7&Price=522 [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 22 guests

cron