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
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
-
What is the best meta description for Category Pages, Tag Pages and Main Article?
Hi, I want to index all my categories and tags. But I fear about duplicating the meta description. for example: I have a tag name "Learn Stock Market", a category name "Learning", and a main article "What is Stock Market". What is your suggestion for meta description of these three pages that looks great for seo google?
On-Page Optimization | | mbmozmb0 -
Best .net cms and ecommerce platform for seo?
Hi and thanks for looking. Due to internal constraints we are looking at a .net cms and ecommerce solution, I would have preferred a magento and wordpress solution but we have to work within our constraints. Can anyone share their experiences or thoughts on what cms they would use with seo in mind and what eCommerce platform, again with seo in mind. thanks again for looking and all replies gratefully received.
On-Page Optimization | | Renford_Nelson1 -
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 -
Creative ways to dramatically increase content on ecommerce category pages?
I need to signficantly boost the content on the category pages on my ecommerce website. Currently, they're pretty thin, with some only having approx 50 words of unique content. In the past, I've intentionally kept the content on these pages quite light, to keep the aesthetic a certain way. It's a fashion-based site, so it's very much about the visual. However, with the introduction of Panda, I need to change this mindset. But, there must be slightly more creative ways to boost the content to stop the pages looking too text heavy. I'm not talking hidden text or anything, but ways to break it up in different blocks on the page to make it look natural/relevant, while keeping it looking great. Anyone have any good ideas? Or, any links to ecommerce sites that have employed brilliant methods?
On-Page Optimization | | Coraltoes770 -
What is the best way to have two online stores, each focusing on a specific country?
The dilemma here of course is that the stores will be very similar in content, with the domains only being different in that the store targeting the US will be a .com domain and the Canadian store is a .ca domain.
On-Page Optimization | | absoauto0 -
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 -
Proper way to change keywords without losing ranking
Hello Everyone, The website I am working with offers service in two locations, lets say Service in City A and Service in City B. Those two cities, which are close by, are the main source of clients, so the owner asked me to concentrate on these terms. I did a decent job for a newbie and now we are on the first page of google closer to the top for these 2 terms. The problem that I am facing right now is that a) it hard to get that extra bit from onsite optimization when you optimizing for 2 different cities b) Customers may get confused which cities we focus on A or B? We have locations in both. c) Owner wants to expand services to additional cities. So I looked at how our competitor handling these time of problem and most of them have a page with titles like "Cities we serve" with links to the individual locations that are optimized for the specific city. That page usually includes paragraph or two about local history and then re-span description of their services. Is it a good practice to structure one's website like that if you are trying to target multiple locations? Should I re-target my home page to something less geographically specific and create separate pages for Cities A , B and the new locations? Would I lose ranking for terms service in city A & service in city B because of that Or should I leave my home page optimized for Cities A & B and just add new locations as separate pages? Thanks in advance for you insights.
On-Page Optimization | | SirMax0 -
Necessary to redirect non-www to www?
Hello All, I've read quite a bit on here and the Matt Cutts blog http://mattcutts.com/blog/seo-advice-url-canonicalization/ about non-www vs www. I''ve also read a few recent posts on here but still left a little confused. First, my site is PR 4. We don't have many links, but the ones we do have (including internal) point to the www.example.com. You can also get to our site by typing example.com and it will not switch to the www. version. Both versions have the PR4, I just want to make sure I'm not losing any PR or juice between the different versions. My question, would you advise 301 redirect to the www version? if so, I have Godaddy as our host, is it as simple as going into the hosting control and doing the redirect there?
On-Page Optimization | | someoneguy0