?
Solved

301 redirect from old site to new site

Posted on 2010-08-22
10
Medium Priority
?
377 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:Tony McCreath
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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

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:Tony McCreath
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
 

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:
Tony McCreath earned 2000 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:Tony McCreath
ID: 34760109
Cheers @arober11
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
When the s#!t hits the fan, you don’t have time to look up who’s on call, draft emails, call collaborators, or send text messages. An instant chat window is definitely the way to go, especially one like HipChat. HipChat is a true business app. An…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

743 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