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
-
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 -
Best Tool for Retrieving Multiple URL Word Counts in Bulk?
I am doing some content analysis with over 200 URLs to go through! Does anybody know of, or can recommend any bulk on-page word count checkers which would help with the heavy lifting? Any suggestions are greatly appreciated. Thanks!
On-Page Optimization | | NickG-1230 -
Auto loading articles ?- best practices
Hi all! In the past months I see more and more website that doing 'auto loading articles in scrolling' - can you tell me if it's okay for SEO and what are the best practices for this? Thanks!
On-Page Optimization | | JohnPalmer1 -
Should old pages that have being 301 redirected but have no/mimimal traffic be deleted?
In other words, I have pages from years ago that are redirected but how can I tell if traffic still flows through them? And if there is no or minimal traffic should the 301 be deleted? Linck
On-Page Optimization | | LinckB0 -
Should we consider redirecting a high ranking subdomain page to our homepage?
My site bluecotton.com sells custom printed t-shirts. Our DA is 46. Our homepage is PA 55. The design studio is where users create their designs. Over the years the design studio has received a lot of fan fair including links from gizmodo and adobe. When I rank against our biggest competitors customink, ooshirts, uberprints.com I find that our domain as a whole doesn't look all that great. However, when I look at the history of our subdomain I see that we are more trusted and credible than all of our competitors. We have 10k links pointing to the design studio. Here is my question. What if I did 301 redirect of bluecotton.com/studio.html to bluecotton.com? Then I created a new url for the DS. This would not cause users any problems. In fact for many they would get more context around what we are trying to do and what we offer. Is this crazy? I never find results in google for the design studio. It always shows our home. That is pretty much what happens to all of our competitors on the higher traffic terms that are driving real sales. So why do i ask? If my subdomain is more valuable becuase of the design studio links then I wonder if I redirected it to the homepage if it would supercharge my homepage and propel is forward in the serps. Thoughts?
On-Page Optimization | | bradwayland0 -
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 -
What's the best way to tackle duplicate pages in a blog?
We installed a WP blog on a website and the below result is just an example. All of them lead to the same content. What's the best way to resolve it? http://www.calmu.edu/blog/
On-Page Optimization | | Sangeeta
http://www.calmu.edu/blog/calmu-business-spotlight-veev/
http://www.calmu.edu/blog/category/business-buzz/0 -
SEOMOZ crawler ignoring redirect?
My crawl report for www.poker-coaching.net show a number of duplicate content warnings.
On-Page Optimization | | CatfishTPA
First, it shows a warning for www.poker-coaching.net and www.poker-coaching.net/, although there is a redirect in place for this, and for non-www. to www. as well. So IMO there is no duplicate content here, so why the error message?
Next, it shows a duplicate content warning for a number of pages, but when I click the number on the right, there is no info an which pages contain the duplicate content. Will this info be there later when the crawl is completed? My problem is that this is my oldest site, but since over one year it seems to have a penalty which I can't get rid of - I cannot identify the reason for the penalty. I already rebuilt the site from scratch once, but I still do not see results. If a membership at SEOMOZ would be able to help me bring this site back on track, that would already be worth one years membership fees, so I'd really be very thankful if someone could take a look at the site and give me an idea about what needs to be done here.0