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
-
Avoid landing page redirects C (75) SERVER HIGH What's this mean?
HI we have a wordpress website with a chain of redirected urls? one is with www. the other without? How do I found out where this is? or what could be causing it? Any help much appreciated 🙂
On-Page Optimization | | KellyDSD861 -
Keyword in Domain AND Title. Yes or No?
We're working on a new buildout, and this one is really important to us. We've put a lot of resources into it. Before we launch, we want the structure to be just right... and this one question is nagging at me. How to structure urls? Consider these two options. The fictitious domain is "icesurfing.org". Including all 50 states in the keyword, there are nearly one million searches per month for "ice surfing [state]". We have a page for each state to focus on this traffic. But how would you structure the urls and titles? **icesurfing.org/state ** icesurfing.org/ice-surfing-state One concern is that the duplicate keywords in option 2 seem redundant, and a little spammy. When presented with google search, the matching tags are not as clean. Texas - IceSurfing.org Ice Surfing Texas - IceSurfing.org But Yoast automatically suggests option 2. Is this really the best practice? Is there are definitive article on this? THANK YOU!
On-Page Optimization | | RetBit0 -
Moving from Bigcommerce to Woocommerce on WP. Should we redirect size pages into one page?
We are moving from Bigcommerce to Woocommerce on WP. On Bigcommerce, due to some bizarre reasoning the previous developer had 3 separate URLS for the same product in different sizes - S, M and L. Now we plan to have one product page where the sizes can be selected and 301 redirect the 3 urls to the new one. Is this advisable? Or should we just have 3 separate pages. OR should we have one of the sizes pages as the new page and then redirect the other 2 to this one? I ask this because the site has a LOT of ranking power and we do not want to jeopardise that.
On-Page Optimization | | MashBonigala0 -
Unique Geo-targeted domains v. simple landing pages
I have a client with multiple locations in a central area. Is it better to purchase unique geo-targeted domains i.g. DowntownTopekaPlumber.com and MidtownTopekaPlumber.com and create area specific splash pages with links back to the main site -OR - is it better to simply create landing pages on the main domain - www.GoodGuyPlumbing.com/DownttownTopekaPlumber?
On-Page Optimization | | SearchParty0 -
Reverse 301 redirect - how will that work?
Hi We have done some testing where we have changed our URL to a new name and 301 redirected the old to the new. It has now been decided to go back to the old url again but is there an seo risk to this? Will all the inbound links that as redirected in the first change be lost or?
On-Page Optimization | | AndersDK0 -
Rebranding and Domain Name Changes
Hi All, One of my clients wants to rebrand http://indiaretailnews.com/ so that it's clear that the site is under the operational umbrella of http://tradebriefs.com/. indiaretailnews.com has a lower domain authority of 20, but because of the domain name it ranks number #2 for the keyword "retail news" for Google India. The client's question: Can we change the site names to TradeBriefsRetail.com orTradeBriefsIndiaRetail.com without affecting the SEO on each site? How do we do this – redirect from TradeBriefsIndiaRetail.com to IndiaRetailNews.com and so on or simply put all the content on the new sites and get rid of the old domains or some other way? Do long domain names cause a problem? Another option is TradeBriefsRetail.in, etc with the domain extension showing the country that the content is for.. In a year or two, we will be expanding to markets outside India. My opinion: Keep the old domains and redirect to something like http://tradebriefs.com/india-retail-news Or perhaps a subdomain: http://indiaretailnews.tradebriefs.com In the short term, I'd imagine rankings will drop, but if we wanted to consolidate domain authority, I was thinking that http://tradebriefs.com/india-retail-news would be the best bet. Thoughts? Kenji
On-Page Optimization | | KenjiCrosland0 -
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 -
Temporary Redirects
On my crawl report from SEOmoz, I have a lot of Temporary Redirects listed. The referring site is a product category page, but the URL listed is part of a shopping cart. For example: | http://www.adagiowaterfeatures.com/cart.php?action=add&product_id=496 | Tested true for a temporary redirect referred by this url: | http://www.adagiowaterfeatures.com/categories.php?category=Free-Standing-Water-Features/Harmony-River-Collection | Why does this occur and what can I do about it?
On-Page Optimization | | AdagioWaterFeatures0