Hot answers tagged

15

UPDATE Sept-2019: Google's recent changes to Google Search Console has made my original answer (below) a bit outdated and in some respects incorrect. You can now submit two different types of properties in GSC: "URL-prefix property", which is the same as the property type mentioned here. In this case you would still submit all variations as required, ie ...


9

For your first two rewrites (non-www → www, http → https), the following rule should work: RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !=www.example.com [NC] RewriteRule ^(.*) https://www.example.com/$1 [NS,L,R=permanent] Just replace www.example.com with the actual canonical hostname of your site. As for your third ...


8

First you should address how search engines crawl your site and avoid duplicate content issues by making sure you have the www subdomain (www.example.com) redirecting to your root domain (example.com). The most efficient way to do this is to create a DNS record - see the first example here on how. You should also use your web server's configuration to ...


8

Browsers don’t further access the server when the certificate is not trusted/valid, so the .htaccess redirect can’t work (it should work as soon as the user adds the certificate as an exception). The best solution is to get a certificate for the hostname with www, too. This does not only help for redirecting users to the correct hostname when following ...


7

No, you don't need to submit a sitemap for the version (here with www) you don't want to use. Remember submitting a sitemap to your Google Webmaster Tools account helps indexing of the site. Therefore, you submit a sitemap only for a site you want to see in Google's index.


6

Yes, this is definitely possible. But please note that, by convention, www.domain.com is just an alias for domain.com. So, what you describe is not at all standard and violates most users' expectations. It also runs at least some risk of search engine penalties. So, in my opinion, it is not a good idea, but yes, it's possible. Exactly how you do it depends ...


6

It's a good idea to redirect example.com to www.example.com. Because you can't use a CNAME for example.com's DNS record, which greatly reduces your options for things like load balancing and resilience.


5

Updated based on the comment provided by @Lèsemajesté This happens because FF and IE9 have chosen to implement an anti-cross-domain DRM mechanism for web fonts. I fixed it by using the following code in my htaccess file to pin the site to a single domain no matter which version of a url it's accessed from (this also seemed useful from an SEO point of view)...


5

Look for 301 redirection rules in your .htaccess or in httpd.conf. In httpd.conf look for a rule like this one: < VirtualHost www.domain.com > Redirect 301 / http://domain.com/ < /VirtualHost > In .htaccess look for a rule that looks like: RewriteCond %{HTTP_HOST} ^www.domain.com [NC] RewriteRule (.*) http://domain.com%{REQUEST_URI} [R=...


5

You have to question some confusion, so I'll talk about ways to do a redirect from www to no-www: 1.Create two VirtualHost for two domains and use 301 redirect: NameVirtualHost *:80 <VirtualHost *:80> ServerName example.com DocumentRoot "/path/to/site" </VirtualHost> <VirtualHost *:80> ServerName www.example.com Redirect ...


5

www is just a subdomain. A website owner will normally make the decision whether they want their domain to be domain.com or www.domain.com. If your website resolves to both the no-www version and the www version of your domain, then these are essentially two different URL's that your website is on so potentially causing duplicate content which is best to ...


5

Use this. It should save you from two headaches. RewriteEngine On RewriteCond %{HTTP_PORT} 80 [OR] RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ https://example.com/$1 [R=301,L] this also allows any URL that starts with http://www.example.com/ or that connects to port 80 (the standard web port) to redirect to https://example.com/


5

The "bad cert thing" is triggered by the browser during the SSL handshake. This is the very first thing that happens and occurs long before .htaccess or any of your server-side logic has a chance to do anything. As you suggest, "the browser is refusing the connection before htaccess has a chance to act". So, if your SSL cert is only valid for the apex ...


4

%20 is an ASCII character for blank space, so they have accidentally put in a white space before www. when configuring the DNS records. This is probably a result of cutting and pasting from an email! You just need to mail them and ask them to remove the space.


4

There's no intrinsic reason for either www or non-www (or http/https) to perform better than the other. The issue, usually, is content duplication arising from a site being accessible on both. WWW non-WWW For instance, if you site resolves on both http://thomas.com and http://www.thomas.com, then a search engine could index both versions, people can share ...


4

Canonical Tag The canonical tag tells search engines what the URL of the current page should be. <link rel="canonical" href="http://www.example.com/mypage.html" /> tells search engines that the current page should be indexed at http://www.example.com/mypage.html even if they crawl it at http://example.com/mypage.html Base Tag The base tag tells ...


4

You should register your site twice in Google Webmaster Tools. Once without the www and once with it. The two often show different errors and different pages indexed. It is useful to know all about your site, not just what you can see with one or the other. You should then choose one or the other to be the canonical site. Make it so that users have to ...


4

If you have something to redirect, then yes, otherwise, it's not. By that I mean, that just doing the no-www to www is important, but not essential. Plus most hosting places already do that for you. In any case, it's a good practice to redirect the no-www to www or viceversa.


4

http://www.example.com and www.example.com would refer to the same thing. Modern browsers assume that the protocol is http://. Some browsers are even starting to hide the implicit http:// when showing URLs in the URL bar. www.example.com and example.com can be very different. It is possible to run two different sites at those addresses with completely ...


4

You should redirect one to the other as two pages the same can never be good but as far as the choice of www. or 'naked domain' it is totally up to you. I was taught to have the www. as default but with the growing number of social media websites dispensing with this I think it is pretty common to see both. It all depends on: Does it look right without? How ...


4

What webserver are you running on? Nginx To remove www in nginx do the following. if ($host = 'www.example.com' ) { rewrite ^/(.*)$ http://example.com/$1 permanent; } That will strip the www. To force https: rewrite ^ https://$server_name$request_uri? permanent; Along those lines. Apache Force https: RewriteEngine On RewriteCond %{HTTPS} !=...


3

It's true that www is typically a CNAME or PTR record -- it could also be a subdomain, in case there are CNAMEs or PTRs for en.www.example.com or ru.www.example.com. I most often see example.com redirected to www.example.com, but I prefer the other direction, and publicize my own sites without the www.


3

If you set example.com and www.example.com to the same IP address (www is a CNAME of @) then it depends how you have it configured on the server. You should NEVER have a website load for both the naked domain AND the www subdomain. I would personally pick which you want to run the site on: www or naked domain. If you want to run it on www, go to http://...


3

If I were you, I'll do all work at the same time to not to tell to Google your URL have changed twice. Indeed, changing URL structure can affect SEO; that's why it's good to change URL structure one time for good (and not often). Otherwise, I confirm your actual SERP positions will be not so good for some time. In order to get back your SERP positions, ...


3

Yes it is true and no it hasn't changed. You should set a redirect from one to the other, or use the canonical tag to reference the canonical URL. (on this page they use an example of a URL with and without www). As you mention Google is pretty smart and is usually quite good at figuring this out, but I often still see Google indexing both versions of URLs (...


3

If you want to explicitly tell Google to show your domain with the www you can set your preferred domain in your Google Webmaster Account. The preferred domain is the one that you would liked used to index your site's pages (sometimes this is referred to as the canonical domain). Links may point to your site using both the www and non-www versions ...


3

I would prefer they are treated as one unified site by allowing Dreamhost to do a moved permanently redirect on one or the other. Yes, this is the "best practise". However, you can also set this preference in Google Webmaster Tools - although this only affects Google. What research is available that shows one style is more comfortable to users than the ...


3

Use an alternative verification method. For example, DNS TXT record ("Domain Name Provider").


3

If you take all the right steps, there isn't a lot to worry about. 301 all existing pages (This is the major step!) Set all you canonical tags right (This is your 2nd most important step) You will lose a little PageRank for the redirect, but we're talking minimal amount here, nothing a little time won't fix. Just read up on how to migrate sites (which is, ...


3

SOURCE Add all variations of your site to WMT While the site address move tool may not treat protocols, url changes and sub domains as new sites, the rest of Webmaster Tools does treat protocols and sub domains as separate sites. You should add all variations of your site, below is an example of my site BYBE added to WMT with all variations,...


Only top voted, non community-wiki answers of a minimum length are eligible