Solved

301 redirect from old site to new site

Posted on 2010-08-22
10
355 Views
Last Modified: 2013-12-09
Hi

I have my site hosted at squarespace.com and now I want to move to a wordpress site instead.

My Squarespace site at lets say oldsite.tv will be moved to newsite.dk

I can't edit .htaccess on the squarespace site. So my plan is to point oldsite.tv to newsite.dk with a cname.

But how do I handle users who find a link in google that points to http://oldsite.tv/guides/how-to-do-this.html so that they receive a 301 permanet redirect to http://newsite.dk/how-to-do-this.html

I guess I need a .htaccess in the root of my new domain, but I can't quite figure out what conditions I have to put in it to make this work.

Cheers
Per
0
Comment
Question by:deploydeploy
10 Comments
 
LVL 4

Expert Comment

by:Frozenice
ID: 33496498
just place on your htaccess file like this

redirect 301 /old/old.htm http://www.yoursite.com/new.htm
0
 

Author Comment

by:deploydeploy
ID: 33496531
Hi

Thanks for your reply. I'm just not sure thats enough.
So if a user in google finds the link:
http://oldsite.tv/guides/a-page.html
He will go to my new website and the .htaccess file should then make a 301 redirect to http://newsite.dk/a-page.html

Will your:
redirect 301 /guides/a-page.html http://newsite.dk/a-page.html
Do that?

And as a little followup, what if I need 200 pages with the style http://oldsite.tv/guides/blabla.html to be redirected to http://newsite.dk/blabla.html


Cheers
Per
0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 33498899
I did something like in the code snippet.

You should also register both websites with Google Webmaster Tools and tell them about the change of address. It should help things go more smoothly.
RewriteCond %{HTTP_HOST} ^.*oldwebsite\.com

RewriteRule ^(.*)$ http://www.newwebsite.com/$1 [R=301,NC,L]

Open in new window

0
 

Author Comment

by:deploydeploy
ID: 33498925
Hi

Also nice input but that doesn't quite cut it. As I described above, I also make changes to the url-structure after the domain name.

I go from:
oldsite.tv/GUIDES/some-page.html

To:
newsite.dk/some-page.html

Your suggestion would result in:
newsite.dk/GUIDES/some-page.html

I need:
newsite.dk/some-page.html

I hope I have made myself clear now.

Cheers
Per
0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 33499439
My case was the same. If there is no pattern to the mapping, then you will have to map every URL separately:


# map known URLs

RewriteRule ^GUIDES/some-page.html$ http://newsite.dk/some-page.html [R=301,NC,L]

RewriteRule ^GUIDES/other-page.html$ http://newsite.dk/other-page.html [R=301,NC,L]



# directly map the rest

RewriteCond %{HTTP_HOST} ^.*oldsite\.tv

RewriteRule ^(.*)$ http://newsite.dk/$1 [R=301,NC,L]

Open in new window

0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:deploydeploy
ID: 33499592
Well I have a pattern:
/guides/ needs to be stripped away.

I just can't figure out the syntax to doing so.

I have lots of post like this: http://oldsite.com/guides/08/22/2010/apage.html

I want a 301 redirect to http://newsite.dk/apage.html where the word guides and /08/22/2010 are stripped from the url.

Cheers
Per
0
 
LVL 23

Accepted Solution

by:
Tiggerito earned 500 total points
ID: 33500413
I've not done fancy redirect rules but I think this may work for you:
RewriteRule ^GUIDES/(.*)$ http://newsite.dk/$1 [R=301,NC,L]

Open in new window

0
 

Author Comment

by:deploydeploy
ID: 33503490
Thanks, I think I need another opinion too, because your not quite certain.

Cheers
Per
0
 
LVL 26

Expert Comment

by:arober11
ID: 33604459
Hi, Tiggerito rule will do what you ask.

0
 
LVL 23

Expert Comment

by:Tiggerito
ID: 34760109
Cheers @arober11
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now