Solved

301 redirect from old site to new site

Posted on 2010-08-22
10
369 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
Monthly Recap

May was a big month for new releases from Linux Academy! Take a look at what our team built recently in our blog. You can access the newest releases from our blog.

 

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

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to count occurrences of each item in an array.
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…

705 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