Solved

301 redirect from old site to new site

Posted on 2010-08-22
10
358 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.

920 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

16 Experts available now in Live!

Get 1:1 Help Now