The best way to redirect to www
-
What is the best way to redirect non www to www. I saw a lot of the solution. is this one ok?
RewriteCond %{HTTP_HOST} !^www.seomoz.org [NC]
RewriteRule (.*) http://www.seomoz.org/$1 [L,R=301]
-
Glad you got it. The code I like to use:
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]Of course, replacing "domain" with your own domain.
Let us know if you need any more help.
-
yes, a lot of people don't know that you should verify both the www and non www version of your site in Google Webmaster Tools!
-
This works:
RewriteCond %{HTTP_HOST} ^domain.com$ [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
and to select preferred domain name first I need to add non www version of the website and that's why I received an error.
You help me a lot!
-
What is the server error you are getting with the .htaccess file?
You do indeed need to verify ownership of you site, it's real easy to do, it involves adding a small piece of code to your site. See http://support.google.com/webmasters/bin/answer.py?hl=en&answer=35179 -
I got server error with .htaccess file and in webmaster tool message "Part of the process of setting a preferred domain is to verify that you own http://
-
That solution works just fine.
It looks like the one from the SEOmoz "Redirection SEO Best Practices"
I've never had any problems with it.
Also to keep things tidy, be sure to tell Google Webmaster Tools that your preferred domain is **www.**domain.com
GWMT -> configuration -> settings -> display URL's as www.domain.com
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
-
Site has 302 redirects for HTTP to HTTPS when it should be 301
Hey all, In the latest Moz crawl, certain pages on our website have shown as having 302 redirects for the http to https, but not all. There should be a 301 solution, but wanted to see if anyone had any advice or guidance. Thanks!
On-Page Optimization | | Julzseo1 -
Best way to give away rank?
We have a set of branded and unbranded keywords that we want our product site to rank very high for. Right now, our support site owns the first page of rankings for most of the keywords we care about. What is the most efficient way to give the rank currently enjoyed by our support site to our product site? Both have very high domain authority and tons of backlinks. Here are some factors that might apply: Support site has lots of copy including these keywords, while product site doesn't (yet) Support site doesn't currently include a lot of links to the product site (and vice versa) They're on the same domain -- support is at support.domain.com, product is on www.domain.com Support site has many more pages and their URLs are more semantically related to keywords I know there are lots of structural improvements implied by the above -- on the product site, increase the amount of copy (and landing pages) focused on keywords and significantly improve internal links, etc. But I'm wondering if the fact we control both sites gives us any options we wouldn't have in a competitive situation?
On-Page Optimization | | hoosteeno0 -
To avoid the duplicate content issue I have created new urls for that specific site I am posting to and redirecting that url to the original on my site. Is this the right way to do it?
I am trying to avoid the duplicate content issue by creating new urls and redirecting them to the original url. Is this the proper way of going about it?
On-Page Optimization | | yagobi210 -
Best category page structure on MY ecommerce site? Advice please
Hi all, I run the site: http://goo.gl/YATL2i I have had this category set up like this for a while now - but wonder if its confusing to google, and potentially my users... let me start by saying my products are available in 3 formats (soon to be 4), so for example i have 3 pages for cctv systems: Analogue / SD cctv systems: http://goo.gl/SPkdYW hd sdi systems: http://goo.gl/uksRAD ip systems: http://goo.gl/UMHBd0 each of the above sub categories then have a further sub category of 2, 4, 6, 8, 10 or 16 camera kit page... I am trying to figure out if it would be better to just have one "cctv systems" page, and use filters in the left menu so users can filter by format, number of cameras etc etc... but these filters would not navigate to other pages but simply limit the view on the one "cctv systems" page. If you think 1 page with filters is best - can you then advise what should i do with all the sub category pages i no longer need? 301 rediret to the main cctv systems page? Basically i currently have my site set up so cctv products are categorised by the format i,e SD, HD-SDI or IP... Which i thought was very important the user doesnt mix formats as it can not work - but am thinking maybe i should catorgorize by type i.e CCTV Camera, CCTV Recorders or CCTV Systems, and then use filters to drill further down in the categories. Any thoughts on this would be much appreciated. thanks
On-Page Optimization | | isntworkdull0 -
What's the best way to handle crawling of photo gallery?
When you have a photo gallery with many search filters and loads and loads of pages, is it best to block all the filters and use google's pagination code? Ex: http://photo.net/gallery/photocritique/filter This site has pages for many different queries. While the page titles are unique, the pages are showing duplicated content.
On-Page Optimization | | cakelady0 -
What's the best practice for handling duplicate content of product descriptions with a drop-shipper?
We write our own product descriptions for merchandise we sell on our website. However, we also work with drop-shippers, and some of them simply take our content and post it on their site (same photos, exact ad copy, etc...). I'm concerned that we'll loose the value of our content because Google will consider it duplicated. We don't want the value of our content undermined... What's the best practice for avoiding any problems with Google? Thanks, Adam
On-Page Optimization | | Adam-Perlman0 -
Redirect sub domain to domain in .htaccessU
Hi all, (Total newbie with fourth post of the last 7 days askin' for help!...sorry!) I've discovered that we have a lot of URLs indexed with for example: http://test.betxpert.com/some-odd-url This gives me duplicate content in the search engines. I have searched the web and i can not find a solution fore redirecting http://test.betxpert.com/some-odd-url to http://www.betxpert.com/some-odd-url. Can anyone help me what to write in the .htaccess file? Best regards, Rasmus
On-Page Optimization | | rasmusbang0 -
What's the best strategy for reducing the number of links on a blog post?
I'd like to optimize my blog better for search. The first reccomendation I got from my SEOMoz Pro Campaign Crawl was that I needed to reduce the number of links per page on my site. I have lots of links from navigational items in the sidebar that people do click on. I'd really like to keep some or all of the tags and categories I list. Comments are another issue. Most of our posts get about 10 comments. However, our best posts get 50-100 comments. Those comments create a lot of links. I was planning on attempting to reduce the number of links using javascript but I guess Google understands javascript now. I may still do this b/c our pages are huge and some progressive rendering would likely help the user experience. Can you use javascript (ajax or otherwise) to limit the number of links on your page in a way that helps your SEO efforts? Any specific suggestions for reducing links that come from comments and navigational items? How much will reducing the number of links on a given page help with SEO? Any simple way to estimate or quantify this without diving in? Thanks in advance!
On-Page Optimization | | TaitLarson0