InMotion Hosting Support Center

redirect all of old website pages to new sites index page

Category: Website

InMotionFans
n/a Points
Asked:
2014-03-25 3:32 pm EST

Hits: 82
I need to redirect all page links to old website to new websites index page. Redirect hasn't worked for this issue.

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

You must login before you can submit an answer.

OTHER ANSWERS

0

JacobIMH
9,968 Points
2014-03-25 3:40 pm EST
Hello, and thank you for your question.

If you are interested in redirecting all pages from an old domain to a new one, you can do so with a <a href="http://www.inmotionhosting.com/support/website/redirects/setting-up-a-301-permanent-redirect-via-htaccess#old-domain-to-new" target="_blank">301 redirect in your .htaccess file</a>.

Specifically for your case, if your old site was <strong>example<span style="color:red;">.com</span></strong>, and your new site was <strong>example<span style="color:blue;">.net</span></strong>, you could use the following rewrite rules to permanently redirect everything.

<pre class="code_block" style="width: 500px; white-space: normal; margin-bottom: -30px;">RewriteEngine on
RewriteCond %{HTTP_HOST} ^example<span style="color:red;">.com</span> [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example<span style="color:red;">.com</span> [NC]
RewriteRule ^(.*)$ http://example<span style="color:blue;">.net</span>/$1 [L,R=301,NC]</pre>

Please let us know if you're having any issues at all getting this to work on your website and we'd be glad to assist you.

- Jacob

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

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!