Mind blowing SEO improving and Google rank increasing Signature Rotator SEO Tool.
htaccess 301 redirect domain to new domain
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?
It is very easy to redirect all the traffic from old domain to new domain with .htaccess 301 redirect.
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]
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]
You can also do
For full site:
This will leave all links intact.
Single Page:
I personally try and avoid the RewriteEngine at all costs.
For full site:
Code:
Redirect 301 / http://WhereYouWantThemNow.com/
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.
(07-21-2013 12:08 AM)chod Wrote: You can also do
For full site:
This will leave all links intact.Code:
Redirect 301 / http://WhereYouWantThemNow.com/
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 Re...
This is a nice post but why do you think we should avoid RewriteEngine ?
(07-23-2013 02:50 AM)marcus_avrelius Wrote:(07-21-2013 12:08 AM)chod Wrote: You can also do
For full site:
This will leave all links intact.Code:
Redirect 301 / http://WhereYouWantThemNow.com/
Single Page:
...
This is a nice post but why d...
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.
My website runs on Apache and I think I have RewriteEngine on my .htaccess. What can I use instead of RewriteEngine?
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.
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!
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"
But I would say everything you do is directed toward improving SEO (search engine optimization) and Google rankings am I right?
(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 "bl...
Then how come so many websites use 301 redirect method and don't have their SEO affected they don't even loose Google rankings!
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!
Also .htaccess 301 redirect is much better than meta tag 301 redirect!
Similar Topics:
- HOW CAN I INCREASE MY SITE'S DOMAIN AUTHORITY?
- Should domain name contain keywords I am targeting?
- How many domain extensions are there?
- What is a Domain?
- What is domain extension?
- Is Domain Name Important in SEO?
- Is domain redirection a good method for SEO?
- Domain age will decide keyword ranking in google?
- How many domain names can I have pointing to my site?
- what is the difference between hosting and domain?
User(s) browsing this thread: 1 Guest(s)