Redirect www.domain to domain
-
How do I redirect www.entrepreneurhandbook.co.uk to entrepreneurhandbook.co.uk
The latter is an existing site.
Thanks
James
-
Good job covering Windows as well as Linux.
-
force non-www
RewriteCond %{HTTP_HOST} ^entrepreneurhandbook.co.uk$ [OR]
RewriteCond %{HTTP_HOST} ^www.entrepreneurhandbook.co.uk$
RewriteRule ^/?$ "http://entrepreneurhandbook.co.uk/" [R=301,L]Add the code listed above to your HTACESS file. This version will redirect both versions to the non-www version. The hashtag won't matter if you have that in there, that is for labeling your redirects. Makes navigating your HTACCESS file a lot easier.
-
It can be a bit tricky.
This short and simple how to might help.
http://kb.mediatemple.net/questions/242/How+do+I+redirect+my+site+using+a+.htaccess+file%3F
-
Alternatively:
Apache Webserver: RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]Windows Server/IIS:
-
Start Internet Services Manager. or start the IIS Snap-in in Microsoft Management Console (MMC).
-
Click to expand * server name, where server name is the name of the server.
-
Right-click either the Web site or the folder that you want to redirect, and then click Properties.
-
Click one of the following tabs that is appropriate to your situation:
-
Home Directory
-
Virtual Directory
-
Directory
-
Under When connecting to this resource, the content should come from, click A redirection to a URL.
-
Type the URL of the destination folder or Web site in the Redirect to box.
For example, to redirect all requests for files located at www.mycompany.com to mycompany.com type http://mycompany.com
- Click OK.
-
-
<code>Add the following to the.htaccess file in the root directory of your site</code>
RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How to increase domain authority?
Hi, I created a new blog about 2 months ago and the domain authority is still at 1 but the page authority is booming like a rocket. How do I increase DA? Please visit my blog and suggest the possible ways. Regards,
On-Page Optimization | | suzy470 -
Use cookie-free domains
Is there anything simple i can install to reduce the Use of cookie-free domains, i have tried to used fooman extension but had major conflicts with other extensions? Kind regards
On-Page Optimization | | Mikaai0 -
Agency Domain Authority Boosting Activity
Hi Guys Have been reading up a bit on methods for boosting Domain Authority and am generally finding that the best way is by producing unique and relevant content through blogs and other kinds of articles. Having multiple clients in an agency means that there is limited time for this and I need something else to assist in boosting Domain Authority. I perform a fair bit of backlinking through online directories, however I am also finding that most blog comment sections have implemented 'no follow' codes to reduce spam content. There are plenty of free online directories, and many with high Domain Authorities, however they can take up to months for the listings to be approved. I am performing other activities to boost keyword rankings in Google for our clients but need some help with getting their Domain Authority up. Does anyone know of an efficient method for boosting Domain Authority for an agency with many clients where blog writing for each may not be a viable option? Would be great to hear anyone's ideas!
On-Page Optimization | | JuiceBoxOM0 -
Page authority still on 1 after url change and 301 redirect
Hi Moz analytics suggestion to help ranking is to have a keyword or phrase in the url so I advised a client to do this they changed one of their pages urls, this page previously had a page authority of 26 since the change its gone down to 1.
On-Page Optimization | | genkee
I advised them that they must do a 301 from the old page but they took a few weeks to do this, would this of affected it why is it not showing up yet its been 3 weeks now, since the 301 and 5 weeks since the url change.0 -
Is www. still important?
How important is the www in front of a domain name nowadays? We redesign a lot of sites and we want to focus on best practices - is it still important to include the www or redirect to shorter (non-www) url?
On-Page Optimization | | jcduron0 -
Duplicate content on domains we own
Hello! We are new to SEO and have a problem we have caused ourselves. We own two domains GoCentrix.com (old domain) and CallRingTalk.com (new domain that we want to SEO). The content was updated on both domains at about the same time. Both are identical with a few exceptions. Now that we are getting into SEO we now understand this to be a big issue. Is this a resolvable matter? At this point what is the best approach to handle this? So far we have considered a couple of options. 1. Change the copy, but on which site? Is one flagged as the original and the other duplicate? 2. Robots.txt noindex, nofollow on the old one. Any help is appreciated, thanks in advance!
On-Page Optimization | | CallRingTalk0 -
My report is showing duplicate titles.. for http://www.mysite.com/ & http://mysite.com
Is this because I setup my campaign wrong in seo moz or should I have my site setup differently to forward all traffic without the www to the www version? Or vise versa? Thanks for any advice!
On-Page Optimization | | Fridaythe15th0 -
301 internal redirects
Hello, I have a lot of low quality pages on my site, many of which have very similar URLs and cover similar topics. I want to tidy up my site by using 301 redirects as Rand suggests here: http://www.seomoz.org/blog/how-to-solve-keyword-cannibalization 1. As a rough rule of thumb, how many internal 301 redirects is too many? 2. Can lots be to the homepage if they're relevant? (I could have as many as 30) Thanks, Kevin
On-Page Optimization | | KMack0