Tag Info

Hot answers tagged

14

Mobile to desktop version should be a choice the user initiates. Sometimes the user may want the mobile version due to: 1) A focused and less cluttered experience 2) Faster browsing for low-bandwidth users (e.g. laptop with a 3G connection) 3) Ability to fit on a small screen Whatever the reason, I don't think deciding for your users is right. Let the ...


10

When your website is too busy due to a large traffic, the best way of redirection is using custom error documents. So, when a user gets 503 error code, the server will redirect visitors to the custom error document page you have defined. There are different ways for different servers to customize error document pages. 1. For Apache server, add the ...


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 ...


7

Working just within the browser, I couldn't tell if a particular direction was due to DNS or the webserver. To view webserver redirects in browsers, open up Developer Tools (either from the browser's menu, or by pressing F12), and click on the Network tab. It's a good idea to look for a Disable Cache option and check this so that all requests are done ...


7

You most certainly do not have to buy store.xyz.com as a new domain name. store.xyz.com is a part of xyz.com A domain name is made up of multiple parts www.google.com www.google.com | | | --- domain name extension | | --- domain name | --- subdomain mail.google.com mail.google.com | | | --- domain name extension | | --- ...


6

You do not want to do a 301 redirect to a 404 page. The 404 HTTP response tells the user-agent (browser, search engine, etc) that the requested document cannot be found. If you send a 301 HTTP response then they will think the document has moved to the new location which is your 404 page. That is not accurate. When you encounter a page not found send the ...


5

It seems like you're aiming for the second-worst outcome. If you're expecting a spike, you have time to do something: Implement in-code caching (can be easy, can take a while to get right) Optimise static files (jpegoptim, optipng, more-css, etc) to reduce bandwidth, speed things up for all users. Move your static stuff to a CDN to remove those requests ...


5

I changed the DNS so it's the same as my website Does this mean your website is now displaying on their domain? If so undo this ASAP, as this will create a duplicate of your site, which could have na adverse effect on your sites ranking. You should 301 redirect their domain to your domain. Where possible redirect pages on their site to relevant pages ...


4

From an SEO standpoint, moving from a keyword domain to a company branded domain is a good move. The 2014 SearchMetrics Ranking Factors found that that having keywords in the domain name is no longer a significant ranking factor. I consider hyphens in domain names to be bad for rankings as well. Moving to company branded domain name is a good move for ...


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} ...


4

Actually I just found an answer to my own question addressed in the relevant RFC 7230 (or its predecessor RFC 2616), e.g. in the description of status code "303 See Other": Except for responses to a HEAD request, the representation of a 303 response ought to contain a short hypertext note with a hyperlink to the same URI reference provided in the ...


4

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/


4

You could make a very simple test to see if there is www in the URL, and if it hasn't, go to the www version via a 301 permanently moved header: if( substr($_SERVER['HTTP_HOST'],0,4)!='www.'){ header('Location: http://www.'$_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI'], true, 301); } Don't forget to set your canonical tags to www so bots know your ...


4

It isn't necessarily bad for SEO. You want to be careful of "sneaky redirects" (see https://support.google.com/webmasters/answer/2721217?hl=en), but this type of behavior should probably fall in acceptable territory. Honestly, from an SEO perspective, you'd be better off redirecting the broken URL to a legit page on your site via a 301 server side redirect. ...


3

Google Webmaster Tools change of address tool is only for sites that move to a whole new domain name. It doesn't cover cases such as: Moving from HTTP to HTTPS (or the other way around) Moving a subdirectory or subdomain to its own domain name Consolidating several sites into one Changing URLs within a site The reason that the tool exists is that new ...


3

Google has a site migration howto. A protocol change counts as url modification; this is the relevant section. The switch goes much like a regular HTTPS switch. Once your urls are made protocol-relative, and before you start redirecting, you should validate the https site in Google's webmaster tools. It's a separate site with its own sitemap. There is no ...


3

This looks pretty spot on to me, apart from on the Spanish desktop site set, where there are quite a few errors. You are referencing the mobile version with the three rel="alternate" hreflang= tags, you should be referencing the desktop version. The canonical tag on the Spanish desktop is pointing to the English language page. If you need to set a ...


3

I don't see why not. The question here is whether you think it will benefit your users or not. Personally speaking, I find it a tad bit annoying whenever I'm brought to the mobile version of a website, even though I'm using a desktop computer. Do note that you should create some sort of URL fragment that can be used whenever you do not want to be redirected ...


3

Let the user choose. Few things are more frustrating than being forced to use a lacking mobile site. Consider allowing desktop users to choose mobile as well -- perhaps they're tethering their laptop to their unrooted iPhone and would appreciate the low-bandwidth alternative for their limited data quota. I think you will find the first problem case ...


3

It is very hard to get local directory sites ranked in search engines these days regardless of whether or not the content is temporary. See this parody letter purportedly from Google, but really written by somebody unhappy that Google is not including directories in the search engine often. As for your temporary premium listings, I wouldn't change the URL ...


3

Never treat Googlebot any different than actual site visitors You should never treat Google bot any different from actual users. Redirecting Googlebot using user agent or other similar tactics and not users will likely harm your site as its against Google's guideline rules. Cosmetic changes say hello to canonical links If the beta site has the same ...


3

The best way to do this is with a rel canonical link tag in the head of each of your pages. So the home page of both your main site and your bet site would have this: <link rel="canonical" href="http://example.com/" /> And foo.html on each would have this: <link rel="canonical" href="http://example.com/foo.html" /> That way Google knows ...


3

It is very common practice to redirect to error pages when putting in a large class of redirects. In addition to wholesale HTTP to HTTPS redirects, this often happens when: You redirect from naked domain to www (or the other way around) You redirect from one domain name to another You redirect an entire directory Redirecting to a 404 page may not be ...


3

From the mod_rewrite documentation you need to use the NE (no escape) flag when your rewrite rule has a hash: RewriteRule #(.+)$ /? [L,R=301,NE] You commented that the NE flag may only apply to the target URL and not the rewrite pattern. If that is the case, another approach would be to escape the # sign. mod_rewrite supports \x style escape sequences. ...


3

There are things you can do at a number of levels: Network Level Network Hardware: Install a load-balancer, with addition servers behind it. This will allow you to run your existing set-up fairly easily, but will probably cost quite a lot of money to setup in the time frame you have (depending on your hosting providers support levels) Virtual Hardware: ...


3

That should be: RewriteEngine on RewriteCond %{HTTP_HOST} !^www.domain.org$ [NC] RewriteRule ^(.*)$ http://www.domain.org/$1 [L,R=301] The "$1" tells mod_rewrite to add the matched text from inside the parentheses in the pattern to the rewritten URL, which is what you want.


3

While it isn't impossible to host multiple secure sites on a single IP address, thanks to SNI and SAN, the redirect you're trying to do is impossible without one of the aforementioned solutions. In order to receive a redirect from https://www.olddomain.com, the browser must have already requested that URL using SSL/TLS, and is expecting an encrypted response ...


3

We have gotten a few questions like this one. While I found one good answer for you, I thought I would take this opportunity answer the question better. There are actually two things to consider and not just one. When you want to retain the links of an old site you have essentially two tasks: one, to redirect from one site to the other properly; two, ...


3

To redirect everyone else, apart from your IP address (eg. 123.123.123.123), to the /blog subdirectory then you can use something like the following in .htaccess: RewriteEngine On RewriteCond %{REQUEST_URI} !^/blog/ RewriteCond %{REMOTE_ADDR} !=123.123.123.123 RewriteRule (.*) /blog/$1 [R=301,L] If the requested URI does not start with /blog/ and the IP ...


3

The first parameter of RedirectPermanent should be a path, not a full URL (e.g. RedirectPermanent /foo http://example.com/bar), so you won't quite be able to get what you're trying to do to work. You should be able to do it if you split the www part into a separate vhost: <VirtualHost *:80> DocumentRoot /var/www/example ServerName example.com ...



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