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
-
Solve Redirect Chains
I've gotten a few Redirect Issues that involve Redirect Chains, with the https:// version redirecting to the www. version and then redirecting to the right URL. Here is an example:
On-Page Optimization | | Billywig
Schermafbeelding 2021-12-07 om 11.04.32.png I've tried setting a direct redirect between the first and the last URL, but WordPress doesn't seem to allow that (it's overwritten). I've also tried checking the internal links to make sure that none of the links are the first one. They don't seem to be there. Does anyone have any tips on solving these Redirect Chains?0 -
How google treats my two different domains with the same content ?
I have two internet stores for two different markets but in the same language (English), the same content and the same url (only domains different). They are in different servers one in USA another in UK. Example: sample.com (global) and sample.uk (for UK).
On-Page Optimization | | VaidasLinen
Currently sample.com (7 years old) is doing better but not very very well, sample.uk (2 years old) is rated poorly. My question is if it's possible that google will rank both stores well in the future ? Thanks Vaidas0 -
Temporary redirections
Hi all, after crawling my website the SEOMOZ software has warned me about temporary redirections like these: What should I do? What consequences could it have in the SERPSs? Thanks. http://www.tarifakitesurfcamp.com/campamento-bilingue-para-ninos/
On-Page Optimization | | juanmiguelcr
http://www.tarifakitesurfcamp.com/campamento-bilingue-para-ninos/
http://www.tarifakitesurfcamp.com/error-404 http://www.tarifakitesurfcamp.com/campamento-de-kitesurf/
http://www.tarifakitesurfcamp.com/campamento-de-kitesurf/
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/condiciones-generales/www.tarifakitesurfcamp.com
http://www.tarifakitesurfcamp.com/condiciones-generales/www.tarifakitesurfcamp.com
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/en/about-tks/www.giselapulidoprocenter.com
http://www.tarifakitesurfcamp.com/en/about-tks/www.giselapulidoprocenter.com
http://www.tarifakitesurfcamp.com/en/page-not-found/ http://www.tarifakitesurfcamp.com/gisela-pulido-escuela/www.giselapulidoprocenter.com
http://www.tarifakitesurfcamp.com/gisela-pulido-escuela/www.giselapulidoprocenter.com
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/ENCLAVE_3.jpg
http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/ENCLAVE_3.jpg
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/MATERIAL_KITE_3.jpg
http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/MATERIAL_KITE_3.jpg
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/campamento-kitesurf-orca.jpg
http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/campamento-kitesurf-orca.jpg
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/expertos2.jpg
http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/expertos2.jpg
http://www.tarifakitesurfcamp.com/error-404/ http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/gisela.jpg
http://www.tarifakitesurfcamp.com/wp-content/uploads/2013/02/gisela.jpg
http://www.tarifakitesurfcamp.com/error-404/0 -
Lost Page Rank after directing http:// to WWW?
Hi I am trying to redirect all the non www urls to WWW. After I redirected them, most of my category page PR are dropped to 0. Can someone please tell me if this is the normal after effect after the redirect? Example url: this is PR2 before the redirect http://www.ilovebodykits.com/category/95/Body_Kits_Front_Bumpers.html
On-Page Optimization | | ilovebodykits0 -
Best Domain Name for Life Coaching Site
Hello, I am an NLP health coach. I am starting to work with both life threatening illnesses and minor diagnoses. NLP is a type of personal development. I'm wondering what your opinion of the best domain would be, keeping in mind branding, SEO, and usability/rememberability. The term "NLP" is not well known. I will be doing both phone coaching and in-person coaching. My other website (BobWeikel.com) is not very strong because of the lack of keywords in the domain, but it's easy to remember. Options are: NLPTrained.com BobWeikelHealthCoach.com BoiseHealthCoach.com (I'm in Boise Idaho) RobertWeikel.com or whatever you suggest.
On-Page Optimization | | BobGW0 -
Title tag best practices when domain and brand are the same
I know the old standard for title tag optimization is to use your brand name in the title for a multitude of reasons, all of which are indisputable The most important reason being any strength and awareness can aid in click-thru. But does this hold true for exact match domains? Considering the way a search result is displayed, any awareness and strength derived from using the brand in the title is automatically included in the search result of an exact match domain without having to sacrifice valuable characters in the title. The organic value (or value beyond simply seeing the brand displayed and nothing else) can't have that much of an impact, can it? For Example, given the result attached, is it worth it to repeat dog.com in the title if it is already showing in the result? dog.png
On-Page Optimization | | NextGenEDU0 -
Generic domain for SEO versus Brand name
I am currently building a retail e-commerce site in a highly competitive area. We have a generic brand name; e.g. kitchen-knives.com and we also have another brand name, e.g. 'slycers.com' We have 3 options that I can see and I would like to know which is better for SEO. Build generic.com as a blog site. Link to brand.com 301 redirect from generic.com to brand.com. Use generic.com as anchor text in all links 301 redirect from brand.com to generic.com . Use generic.com as anchor text in all links Also, if there are other better options, then I would appreciate the input! thanks
On-Page Optimization | | cestor0 -
Negatives to using custom sub domain?
So - being photographers, we have our main website, but also, we use a hosted service for all our client galleries (www.zenfolio.com) So, in effect, we have two websites: Our main informational website Our client gallery/proofing website The client gallery has back links to our main website - so, when people are viewing their gallery, they can easily get back to our main site. We also have thrown a few of our preferred keywords in there for SEO purposes. The gallery has thousands of pages which link back to the main site. So.. the client gallery URL can either be: http://ourbusinessname.zenfolio.com OR we can have it so it uses our own domain, such as: http://gallery.ourbusinessname.com The question is, which domain name will benefit the back links more? Our custom subdomain (which links to our main domain) or, using the Zenfolio domain (which is external to our site). Or, is there no real difference either way? Or.. do I make no sense?
On-Page Optimization | | blitzna100