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
-
What is the safest way to redirect for best SEO benefits?
What is the safest way to redirect for best SEO benefits? Example: loodgieter-aanhuis.nl -> loodgieters-ambacht.nl Does someone have any technical information on how to (root) redirect for best SEO practices?
On-Page Optimization | | hans-keeren0 -
Press Page Best Practices?
Hey Mozzers! I have a question that I haven't found a perfect answer to yet. The company I work for has built a press/awards/news article page and I'm trying to determine the best format to showcase the information in. (You can take a look at the page here: https://www.webpt.com/about/press Should I have our team copy and paste the press releases onto our site and rel canonical that post to the original article? Or would it be better to just have a short intro paragraph and then have a read full story link at the bottom of that paragraph. Final question--should I make these pages noindex, nofollow? Looking forward to hearing everyone's answers!
On-Page Optimization | | WebPT0 -
Which URL Structure is best for New Website?
Hello All, I have one client and he want to develop his website but the he want the URL structure for his website page like below: http://www.example.com/category/xxproduct.html But I have suggest him below URL Structure http://www.example.com/category/xx-product.html So Can you people please suggest me that from above which URL structure is better from SEO side as well as from Visual side..? Is using - is better to separate the words in URL?
On-Page Optimization | | jemindesai0 -
How can I reduce Too Many On-Page Links? I am looking for best method through which I can reduce by on page link.
Hello, As I have the Pro Account in SEOMOZ . I have created the campaign for my website and I have seen the warring for on page analysis for Too Many On-Page Links. As per my knowledge in past it's matter that you can put maximum 100 links per page but now is it still matter or harm if pages has Too Many On-Page Links? And if yest then please let me know the best method to reduce my On-Page Links with out doing any major changes in website
On-Page Optimization | | jemindesai0 -
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 -
Long tail traffic - what is the best way to go back and add focus to repetitive long tail keywords?
Hey everybody, So, our niche doesn't have a million and a half searches per month, which makes a handle full of visitors look mighty enticing to a CMO Our price point is very high too, so to the question, is it worth taking the time to put a whole new content strategy in line for a few new visitors, the answer is yes. Now's the hard part. How on earth do I make 1,000 pages for similar topics? Is making new pages the best way to go about this? (probably so right? It's the only thing that I can see that would certainly increase likelihood of being more relevant, plus if I don't I will be missing out on the benefits of beefing up our site, AND the opportunity to more specifically answer a users query.) With phrases like "keyword" and "aftermarket keyword," the searcher is asking for two totally separate collections of results. I'm always reading about the importance of being there throughout the buyers complete purchasing /research process, which makes me think that considering doing anything other than creating unique pages is simply missing out.. Suggestions? Massive Content Strategy Help? Anybody? Thanks, TA
On-Page Optimization | | TylerAbernethy0 -
Content placment best for SEO?
We currently have a scroll bar box at the bottom of our page with information in but from what I can see scroll bar boxes at the bottom of websites looking a little spammy (a lot of over optimized websites using them) would we be best in using a strategy like this site www.solopress.com/ which implement a show more link that drops information down would this be read as good information for Google or look just as spammy?
On-Page Optimization | | BobAnderson1 -
Best approach to create a mobile version of a website
Hi all, I have a customer that wants to create a mobile version of his website, he wants to create a subdomain to redirect visitors to the mobile version and this mobile version will be a separate folder hosted on the same hosting. I'm seeing really good things from frameworks like JqueryMobile but I thinks they are not really SEO friendly since they load pages with Ajax. So, the question is: its ok to use this kind of frameworks or should I create all the html and css by myself? I'm really looking forward to use the frameworks, since its faster and less time consuming than creating the whole site with html. But I don't want to waste time if it will not be SEO friendly. Thanks in advance
On-Page Optimization | | Pablotavano0