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
-
Https://www.fitness-china.com/hip-thrust-machine title too long
https://www.fitness-china.com/hip-thrust-machine title too long But we have two keywords Hip Thrust Machine and Glute Bridge Machine it 's ok?
On-Page Optimization | | ahislop5740 -
Prestige Kew Gardens Domain SEO
Hi Team, I have been doing off page seo for my prestige kew gardens for quite some time. It has already been 5 months. till recently is was ranking in range of 200. Now I am able to get to first page from last month. But still I feel I am missing something to get it on top. ON Page Grade for this domain is A. I have used all the moz tool to check any on page issue. Everthing seems to be proper. Can anyone help me on this? http://www.prestigekewgardens.org.in/
On-Page Optimization | | mithungowda0 -
Redirecting pages (old site to new site)
I have a question- there is one location, one set of pages for both the old and new site on the same host environment so when I did the redirect it get into a loop trying to redirect from itself to itself Not sure how its gonna affect SEO. Will pages get hit for duplicate content?
On-Page Optimization | | Yanez0 -
How do I do a 301 Redirect in Wordpress
I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site. I was wondering how to do a 301 redirect for these pages
On-Page Optimization | | SteveSweat0 -
Redirecting URLS on windows
Could anyone help out here please. A client of ours have reveloped their website from HTML to ASP (helpful!). They have 60 odd pages indexed in Google with the .html extension. We need to do a redirect on these pages so that all link juice is passed to the new pages. What would be the best way to do this please?
On-Page Optimization | | Grumpy_Carl0 -
Seo'ing Sub domains for images
We are currently adding some performance improvement to our websites, to improve user experience. One of the things we are looking at is splitting of images over several sub-domains, to increase the number of images that can be downloaded at the same. We have seen that using key phrases within image names has an improvement in rankings. So, the question is should we create sub-domains as key-phrase.example.co.uk or as i1.example.co.uk? K
On-Page Optimization | | soltec0 -
Does Google give any (negative) weight to .info domains?
Hi, All! We're working with a client on setting up a support blog for their site (not hosted on-site because it's a related topic, not directly about their business). We're thinking about a few domain possibilities, but for some of the ones we'd like the .com is already taken. .info (as well as others) are available, and the client is interested in using a different TLD, but I'm shying away from it because of the concern that: a) people will look at it more suspiciously (exactmatch.info? must be spam) - but maybe that's just because I'm an SEO b) does Google have anything against exact match domains with endings like .info, .net, etc.? (I know there's never any guarantee that the exact match domain will continue to hold its weight in the algorithm at all, but taking that as a given for now - and we are planning on putting decent quality original content on it). Thanks in advance for the input! Aviva
On-Page Optimization | | debi_zyx0 -
Www1 and www domain
hi, I have a client who has an e-commerce business. My client does not want to fill the pages with too much content and has set up a www1 version with the same domain-name as the www. The plan is to create a lot of content and push www1 in ranking and then sending users (via links) to the www for ordering. Although there will be no duplicate content published on www and www1 this seems like an odd strategy, especially since the www already has a good page rank, and I'm not sure about how engines view a www.domain.com and www1domain.com situation even with unique content in each. Any thoughts?
On-Page Optimization | | vibelingo0