Redirects with coldfusion legacy code

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 1
Joined: 30 Oct 2013, 15:44

Redirects with coldfusion legacy code

30 Oct 2013, 15:51

We have absorbed a site that was ColdFusion so all of the links have the "?" parameter as in
http://www.somesite.com/?p=DogSearch

We need the page to redirect our new site, but the .htaccess file won't allow


RewriteRule ^/?p=DogSearch$ http://www.NewSomeSite.com/about/who-we ... ation.html [NC,R=301,L] because of the "/?p=".

However RewriteRule ^p=DogSearch$ http://www.NewSomeSite.com/about/who-we ... ation.html [NC,R=301,L] does not redirect.

Also, is there a way to do a toplevel redirect as in redirecting www.somesite.com and changing the url name to www.NewSomeSite.com? We have reassigned the DNS so all of the pages on NewSomeSite.com show as SomeSite.com.

Thanks and Cheers!

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Redirects with coldfusion legacy code

31 Oct 2013, 12:37

Hello,

I may have got the questions wrong, but the syntax for URLs with querystring is:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} ^www\.somesite\.com$ [NC]
RewriteCond %{QUERY_STRING} ^p=([^&]+)$ [NC]
RewriteRule ^$ http://www.NewSomeSite.com/%1 [NC,R=301,L]


So any request like http://www.somesite.com/?p=XXXX will be redirected to http://www.newsomesite.com/XXXX

Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 8 guests