MOD_rewrite to redirect URL to different domain

Using mod_rewrite to handle various content issues

MOD_rewrite to redirect URL to different domain

Postby limes_04 » Wed Aug 01, 2007 12:49 am

Hello guys,
I am still a beginner in mod_rewrite. I've been trying to solve this prob since lastweek but still I can't solve this. I need you help with regarding URL redirection to a different domain. I need to redirect this URL:

www.mysite.co.uk/page1.html/?OVRAW=example_phrase&OVKEY=example_keyword&OVMTC=advanced

and capture the value after OVRAW= "example_phrase"


and Redirect to this URL->

http://www.newsite.com/click-2258397-10 ... sid=OVKEY=example_phrase+OVKEY=example_keyword



I really need your help guys. Thanks so much.
limes_04
 
Posts: 2
Joined: Tue Jul 31, 2007 4:29 pm

Postby richardk » Sat Aug 04, 2007 12:01 pm

Something like this
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*&)?ovraw=([^&]+)(&.*)?$ [NC]
RewriteRule ^page1\.html/$ /click-2258397-10478569?OVKEY=%2 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby limes_04 » Sun Aug 05, 2007 5:02 pm

@richard

Thanks a lot! This condition works! It works on my local server..
limes_04
 
Posts: 2
Joined: Tue Jul 31, 2007 4:29 pm


Return to Content

Who is online

Users browsing this forum: No registered users and 12 guests

cron