Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

301 redirect from old site to new site

Posted on 2010-08-22
10
Medium Priority
?
381 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 

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

Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

Question has a verified solution.

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

When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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…
Suggested Courses

636 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