Redirects with coldfusion legacy code
2 posts
• Page 1 of 1
Redirects with coldfusion legacy code
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!
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!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Redirects with coldfusion legacy code
Hello,
I may have got the questions wrong, but the syntax for URLs with querystring is:
So any request like http://www.somesite.com/?p=XXXX will be redirected to http://www.newsomesite.com/XXXX
Regards
Andrew
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
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests