URL Rewriting for a CMS

Discuss practical ways rearrange URLs using mod_rewrite.

Postby Haran » Thu Jul 16, 2009 3:31 am

Hi richardk,
I fixed the previous issue following your suggestion, thanks :)

Since I'm problematic guy, here is another question:

I've been able to customize a bit the CMS so I'm now able to replace spaces and other strange characters with "-" and put everything in lower-case. Please have a look at the old url and the new one:

Code: Select all
old rewritten url:
http://haransite/EN/ITALY-holiday-guide/Campania-on-Campania%20-%20Ischia%20Island/Ischia%20Ponte/Caves%20to%20castles%20on%20Italy%27s%20Ischia%20island/001GVSZP26DHRELP-3FDRT1ZPFKXE

new rewritten url:
http://haransite/en/italy-holiday-guide/campania-ischia-island/ischia-ponte/caves-to-castles-on-italy-s-ischia-island/gvszp26dhrelp/



This is the rule that's actually working with the old url:
Code: Select all
RewriteRule ^([^/]+)/([^/]+)-holiday-([^/]+)/([^/]+)(-([^/]+))/([^/]+)/([^/]+)/([^/]+)-([^/]+)$ /public/snapshot.cgi?cat=$3&area1=$2&area2=$4&area3=$5&des=$7&pname=$8&cdo=$9&loc=$10&lng=$1 [L]


How can I redirect all the old urls to the new ones?


Thanks,
Haran
Haran
 
Posts: 16
Joined: Sat Feb 21, 2009 1:09 pm

Postby richardk » Thu Jul 16, 2009 1:38 pm

Use the old rule to send the requests to a script and redirect with it.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Previous

Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 26 guests

cron