InMotion Hosting Support Center

Different Domain Individual 301 Redirects


InMotionFans
n/a Points
Asked:
2015-07-27 10:50 pm EST

Hits: 205
I have been trying to solve this for almost 2 months now after being assured originally that it could be done.

How can I set up multiple 301 redirects between 2 different websites/domains? For example:

www.website1.com/home TO www.website2.com/home
www.website1.com/products TO www.website2.com/products
www.website1.come/products/cheese TO www.website2.com/products/cheese

So if someone went onto google and type "site:www.website1.com" and it brought up all the various links, upon clicking one, they'd be redirected to the appropriate new page, rather than always being forwarded to the homepage or to nothing. There has to be a way that this can be done.

Why? You might ask. We're currently going through a rebranding and shutting down website 1 in favour of website 2, however website 1 has a significant amount of individual page and domain authority which we want to translate and correlate over to the new, website 2.

I have tried both cPanel Redirection AND .htaccess redirection but neither are working properly (with the exception of cPanel Redirection sending users to the homepage of the new site)

You must login before you can ask a follow up question.

You must login before you can submit an answer.

OTHER ANSWERS

0

TJEdens
Staff
10,077 Points
2015-07-29 12:53 am EST
Hello,

I apologize that you have been working on this issue for 2 months. Can you try this .htaccess code below to see if it will help you as it should.

RewriteEngine on
RewriteBase /
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

I really hope this helps you out so this problem will be done and resolved.

Best Regards,
TJ Edens

You must login before you can post a comment about this answer.

Is that to assume that where you have

RewriteBase/ - The / is where I'd put the end of the URL?
i.e. RewriteBase/products.html
i.e. RewriteBase/AboutUs.html
i.e. RewriteBase/ContactUs.html

And respectively, the $1 after new domain would be the corresponding URL i'm forwarding it to?
CUBAG
3 Points
2015-07-29 8:52 pm EST
Hello Cubag,

Basically, it's taking original URL represented by "RewriteBase /" then based on the Rewrite Rule of "any subdirectory of the original URL" (represented by the ".*") redirecting to the new domain. The "$1" is basically representing any subdirectory in the new domain. The "R=301" indicates this is a 301 redirect, and the "L" indicates that this rule will be the LAST rule to be run if the rule conditions are met.

If you're trying to setup a rule for a specific subdirectory, then you would need to indicate it in the RewriteRule - not the RewriteBase, in this case. The rewrite base is the main URL being used for all of the redirects.

I hope this helps to answer your question, please let us know if you require any further assistance.

Regards,
Arnel C.
Arn
39,275 Points
Staff
2015-07-30 11:42 am EST
Like this Question?

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!