Tag Info

Hot answers tagged

14

Strong vote for a dedicated 404 page. Less confusing for the user Allows you to see more easily if something is wrong (through web server error log, your own logging script and/or Google Analytics) You can tailor the page towards the situation (for example display a list of product categories) Allows search engines to clean up their indexes. No longer ...


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


12

It sounds like what you want is not a redirect but actually a proxy. Check out the information found in the mod_proxy config page. You should end up with something like: ProxyPass /app http://example.com:8080/app ProxyPassReverse /app http://example.com:8080/app


12

While you seem to have solved your problem, you may still experience this same phenomenon going forward. 301 Redirects are Google's recommended way to move content, however they have at least some decaying effect on Page Rank. Google's Matt Cutts was interviewed in March 2010 by Stone Temple Consulting. From the full transcript of his interview: Eric Enge: ...


12

According to the current version of the HTTP/1.1 standard, RFC 2616, the value of the Location header must be an absolute URI. However, in the draft standard prepared by the HTTPbis Working Group to eventually replace RFC 2616, this has been changed to allow relative URIs as well, apparently because: "The definition of the Location header [in RFC 2616] ...


12

If your website is down for a month, you will lose all your rankings and it may take you months to gain them back. I had a website go offline for about 3 months due to an issue with hosting. When I got it back online, it took nearly a full year to get back the rankings that it had once enjoyed. The best idea I have to mitigate the damage would be to use ...


11

302 redirects aren't bad for SEO as they are probably the most common redirect in use today. In fact, PHP's header() function sends the 302 HTTP response by default. Here's what Matt Cutts had to say about 302 redirects. Basically they are fine and Google will find and index those links properly. It looks like Google will show the original URL instead of or ...


11

The answer when you asked on your original question was: Cookies are split and/or duplicated. SSL doesn't work. Inbound links aren't consistent The main thing to understand is that although www.domain.com and domain.com may display the same site, they don't have to, so are treated as separate sites. In detail Cookies are split and/or duplicated ...


10

301 redirects and canonical links are two very different things. A 301 redirect tells the search engine that the page has permanently moved to a new URL and to forward all links, etc, to the new URL. Basically it's a change of address card for web pages. If you change the URL of a page, including the domain name, you would need to do a 301 redirect so the ...


10

I do not know a ton about StumbleUpon but I do know that Google only gives you a slight ding for 301 redirects. So by that measure you should not have an issue with doing a 301 redirect for a page that StumbleUpon is linked to. Google will still crawl it and just see it is now a 301. The only concern I would have is if StumbleUpon removes links that it ...


10

You could make example.com/test.com resolve to the same webserver (IP) via dns (CNAME if you like) and that would work. If you are looking to do this on a per-path basis than no. DNS is ignorant of things like URL. DNS is simply translating the host part of the url (example.com) into IP address. The web server is in charge of figuring out what (or where) ...


10

If the root (/) 301 redirect to /en/, Google will most probably consider your homepage is http://www.example.com/en/ and there is no problem not to have a root (/) page. Regarding Google guidelines for multilingual sites, you can use this method to separate languages on your site.


8

Options: Set up a local site for testing purposes. Something like WAMP should do the trick. If you're going to do the testing on your live server, temporarily block your site while doing your testing. A 307 HTTP response would be appropriate. Use basic authentication to keep crawlers and everybody else out while you do your testing. Since your site will be ...


8

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

As has been noted, this can not be done entirely with DNS. However, if you have the DNS for example.com refer to the same server as test.com it is very simple to configure Apache to accomplish what you wish to do. Just add the following: <VirtualHost *:80> ServerName example.com Redirect permanent / http://test.com/ </VirtualHost> This ...


7

This snippet will force the www to always be in thew URL. I don't know if that helps you or not: Options +FollowSymlinks RewriteCond %{HTTP_HOST} !^(www\.|$) [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


7

Store your old and new redirect paths in a database. Redirect 404 errors to a special 404 page. With Apache and PHP, you could do this with the ErrorDocument directive in your .htaccess: ErrorDocument 404 /404.php In the 404.php script, get the referring page with $_SERVER['REQUEST_URI'], look up the old URL path in your database, and serve a 301 redirect ...


6

To my mind, it will make more sense to use 410 gone status code in this case. The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not ...


6

Having multiple domains point to one website is common as a company will buy variations of their main domain name (other TLDs, misspellings) and then point them to their main domain so on the off chance that someone uses one of those variations they still will end up at the company's website. As far as SEO goes having so many domains pointing to one place ...


6

If URL 1 and URL 2 are different, then Google is not simply going to start showing the new URL. You have to let Google know of the change in order for them to update their listings. To do this, you will need to use 301 redirects from the old pages to the new so Google can update their URLs. Assuming you are in a LAMP hosting environment, you need to add one ...


6

With a correctly done 301 redirect, as you've noticed, the referred will be the original referer, not the directed URL (foo.com in your example). You should be able to see the 301 redirects to bar.com in the log files for your foo.com site. If for some reason you can see the log files for your foo.com web server, then you could track them using Google ...


6

So .. you have more than 1 .htaccess file: one in the root folder and one in /dev folder. Where did you put rules from @Alex -- root or /dev .htaccess? Most likely in root. That is the reason why it did not worked. Thing is -- if Apache sees rewrite rules in lower level folder, it will NOT execute them from parent folder UNLESS your lower level .htaccess ...


6

@PeanutsMonkey You didn't really answer John's question. At least it doesn't seem so. You just restated that people end up at a porn site. (Maybe you're just being brief at the cost of clarity.) I'm not sure it's even possible to "take over" an existing TinyURL in the way you're describing. Use LongURL to find out where the tinyurl is really pointing. It'll ...


6

Short answer: no. Google Analytics will only track a page view if the page loads and _trackPageview is called. You could call _trackPageview in a "Buy" click handler, but if you're going to do that I'd just fire an event instead.


6

Nginx uses the try_files directive to 'see if something exists and fallback to another option' instead of using if statements and rewrites. Within your server block, create a location block that will match your files (e.g. files ending in jpg, gif, png - add whatever extensions you want). Within that block, you will add your try_files directive. Nginx will ...


6

Section 14.30 of the HTTP 1.1 RFC http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30 is not significantly different. I don't know that you're going to see any actual practical limitations for this. The only time I've seen even a warning about this issue is when I used to test in Lynx and the location was not absolute it would warn you "Location ...


6

First of all, as you're mentioned the reason to change that are cookies - there's no need - see "sub-domain cookies, sent in a parent domain request" on Stackoverflow: The leading dot in the domain value .example.com means example.com and its sub-domains. Without the leading dot, the cookie is only valid for this specific domain. Note that when ...


6

If the domains are serving duplicate content, or even similar content with minor variations, you run the risk of being penalized for that by the search engines. At least, that's my understanding from all of the articles I've read. Irrespective of that, there are many reasons you should be using the <link rel="canonical" href="..." /> tag in your page ...


5

I figured out my issue. You can use a Google Analytics account to track a domain and if you change the domain name and do a 301 redirect from the old to the new you can use the same Analytics tracking code. Note, the 301 isn't required though. However, Google Webmaster does not work the same. When you switch domain names you will need to add the new ...



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