Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.

Thread: 

htaccess 301 redirect domain to new domain

Ads
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#1
Senior Member
Hi I have a website that I don't think is helping me make any money so I have decided to shut it down. But I want to redirect all the traffic from that domain name to my new website. Can I do that with .htaccess 301 redirect?
invisibe_dude Offline referral

Posts: 820
Joined: May 2013
Reputation: 24

#2
Posting Freak
It is very easy to redirect all the traffic from old domain to new domain with .htaccess 301 redirect.
Code:
RewriteBase /
RewriteCond %{HTTP_HOST} !old-domain.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301]

If you run in to situation where "www.old-domain.com" redirects but "old-domain.com" doesn't redirect try this.
Code:
RewriteBase /
RewriteCond %{HTTP_HOST} !old-domain.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} !www.old-domain.com$ [NC]
RewriteRule ^(.*)$ http://new-domain.com/$1 [L,R=301]
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#3
Posting Freak
You can also do
For full site:
Code:
Redirect 301 / http://WhereYouWantThemNow.com/
This will leave all links intact.

Single Page:
Code:
Redirect 301 /myOldPage1.php http://www.example.com/myNewPage.php
Redirect 301 /MyOldPage2.php http://www.example.com/goToFolderNow/


I personally try and avoid the RewriteEngine at all costs.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#4
Support Team
(07-21-2013 12:08 AM)chod Wrote:  You can also do
For full site:
Code:
Redirect 301 / http://WhereYouWantThemNow.com/
This will leave all links intact.

Single Page:
Code:
Redirect 301 /myOldPage1.php http://www.example.com/myNewPage.php
Redirect 301 /MyOldPage2.php http://www.example.com/goToFolderNow/


I personally try and avoid the RewriteEngine at all costs.

This is a nice post but why do you think we should avoid RewriteEngine ?
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#5
Posting Freak
(07-23-2013 02:50 AM)marcus_avrelius Wrote:  
(07-21-2013 12:08 AM)chod Wrote:  You can also do
For full site:
Code:
Redirect 301 / http://WhereYouWantThemNow.com/
This will leave all links intact.

Single Page:
Code:
Redirect 301 /myOldPage1.php http://www.example.com/myNewPage.php
Redirect 301 /MyOldPage2.php http://www.example.com/goToFolderNow/


I personally try and avoid the RewriteEngine at all costs.

This is a nice post but why do you think we should avoid RewriteEngine ?

The biggest reason is badly written Rules can be a major security issue for the webserver or site/sites running on it. There are many exploits one can run on badly crafted rewrite rules. You add overhead with every rule you add in and some people get rule happy I have seen htaccess files with literally thousands of lines in them. To me it is an easy way to get lazy on many things because you can just use a rewrite rule. Also from my 15+ years in IT I have seen these rules bite people in the butt countless times.

Personal preference really, but also I rarely use Apache anymore to host sites. NGINX if I need performance and high availability and lighttpd for small light weight setups. Though I don't say people should avoid it, just be aware of its pitfalls and complications it may/will cause you down the road. Also never blindly copy and paste a bunch of rewrite rules that you do not fully grasp that someone online is saying hey this does that just put it on your server.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#6
Support Team
My website runs on Apache and I think I have RewriteEngine on my .htaccess. What can I use instead of RewriteEngine?
chod Offline referral

Posts: 860
Joined: Jul 2013
Reputation: 85

#7
Posting Freak
It depends on what you are actually using the rules for and if there are alternative methods to get the same action. PM what you have and I can help you clean it up and eliminate as much as possible. Though depending on your host/code/methods some things might be impossible to change.
www.AdminEmpire.com
www.BlimptonTech.com - Best Free Online JavaScript tool to minify JavaScript files.
marcus_avrelius Offline referral

Posts: 2,424
Joined: May 2013
Reputation: 102

#8
Support Team
Thanks chod! But I use a specific plugin so I don't want to mess with that. But thanks very much for trying to help!
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#9
Senior Member
Thanks guys
destroyer Offline referral

Posts: 430
Joined: Jul 2013
Reputation: 3

#10
Senior Member
Is 301 redirect affect SEO?
invisibe_dude Offline referral

Posts: 820
Joined: May 2013
Reputation: 24

#11
Posting Freak
Yes, it does affect it, but only if the main goal of it is improving SEO! Google is smart and now can detect is the redirect is used for "black hat SEO"
ivan Offline referral

Posts: 713
Joined: Jul 2013
Reputation: 6

#12
Senior Member
But I would say everything you do is directed toward improving SEO (search engine optimization) and Google rankings am I right?
destroyer Offline referral

Posts: 430
Joined: Jul 2013
Reputation: 3

#13
Senior Member
(01-28-2014 03:49 PM)invisibe_dude Wrote:  Yes, it does affect it, but only if the main goal of it is improving SEO! Google is smart and now can detect is the redirect is used for "black hat SEO"

Then how come so many websites use 301 redirect method and don't have their SEO affected they don't even loose Google rankings!
gafsystem Offline referral

Posts: 7
Joined: Aug 2013
Reputation: 1

#14
Junior Member
(01-14-2014 09:23 PM)destroyer Wrote:  Is 301 redirect affect SEO?


No Destroyer, 301 is SEO friendly. Also Google assume you permanently moved your page or domain to other page/domain.
surenot Offline referral

Posts: 500
Joined: Jan 2014
Reputation: 16

#15
Senior Member
301 redirect is maybe SEO friendly but if done incorrectly it can really mess your SEO! I am saying that don't use 301 redirect with the objective of improving your search engine optimization, rankings and stuff, only use it if you really need to!

Also .htaccess 301 redirect is much better than meta tag 301 redirect!





User(s) browsing this thread: 1 Guest(s)