Forum Moderators: phranque
In particular, is the last line also known as an Error Code 302 or perhaps something else?
What is an Error 301? Should I use Error Document 302 and/or 301 in the file? What is the difference?
Should I have some other error codes there or is this sufficient? (ignore the spaces, they are inserted so it's non-clickable) Thanks.
ErrorDocument 401 /index.html
ErrorDocument 400 http: //www. examplesite dot com/index.html
ErrorDocument 403 http: //www. examplesite dot com/index.html
ErrorDocument 404 http: //www. examplesite dot com/index.html
ErrorDocument 501 http: //www. examplesite dot com/index.html
ErrorDocument 502 http: //www. examplesite dot com/index.html
redirect permanent / http:// examplesite dot com/
You should never use a canonical URL in an ErrorDocument directive -- Do not include http://www.example.com, just use the local URL-path only, as in your very first ErrorDocument line.
If you use a canonical URL, then the response for that error will be a 302-Moved Temporarily redirect to the page you specify. This behaviour is clearly described in the Apache documentation of ErrorDocument [httpd.apache.org].
The RedirectPermanent [httpd.apache.org] directive will generate a 301-Moved Permanently server response.
You should use custom error documents only if you have something more to offer on your custom error page than what the server offers on its default page.
I specifically recommend that you do not use a custom error document for 500-Server Error for the simple reason that if your server has a serious problem, you want to use the simplest possible method to inform the user (and yourself) that the problem exists. I consider it to be a really bad idea, for example, to use complex PHP, PERL, or other cgi scripts to report serious server errors, because if one thing breaks, then you can get a cascade of errors, and no useful error report. In error handling, simpler is better.
Jim
Always had problems with Adsense refusing to recognize my redirected traffic from several sites going from say a non-developed domain to a fully developed site, using these three methods I have used in the past: 1. server based Domain Pointer forwarding from CP, 2. server redirect via server CP, 3. or my own ftp'd htaccess file redirect (as posted before).
For example, with one site my stats would show 100 visits with 90 of them from a redirect. Adsense would report only 10 visits. When I asked them why they send canned replies merely saying they do not recognize all traffic but little more explanation.
Would error 301 or 302 be the best way to get Adsense to recognize the traffic? Also, which one of those 3 methods is the best?
Regarding the htaccess coding, could you please post a recommended simple file to capture as much error traffic as possible, preferably a generic file which could be used for multiple sites? Thanks.
> Regarding the htaccess coding, could you please post a recommended simple file to capture as much error traffic as possible, preferably a generic file which could be used for multiple sites?
I have no idea. I recommend that you link directly to the correct destination landing page, and require that your affiliates do the same. Once the request is on the final, correct site, then a 301 can be used to remove the affiliate ID and clean up the URL seen by the user if that's what you're trying to do -- this is not a problem for Adwords, and I see no reason why it would be a problem for Adsense.
However, I specifically disclaim any knowledge of what the 'right thing to do' is for Adsense -- I answer mostly technical questions here, and intend to stay in that game. A 301-Moved Permanently is the correct technical response to a request for a page that has been permanently moved, but I have little knowledge of what Adsense's policies are in this regard. I sus[ect that they require the link in the ad to resolve to a final landing page in the same domain as that specifiedin the ad.
If you point all errors on your site to your index page, you will likely suffer massive duplicate-content problems. Don't do that. Use these error handlers to properly handle errors, as intended by the designers of Apache server and the HTTP protocol. Otherwise, you could lose a million dollars trying to save a penny...
400 Bad Request. You'll probably never get this one, except from badly-written or malicious robots. Identify the error, and offer a link to the home page and/or site map. Or just use the default Apache error page.
401 Unauthorized. You won't get this unless a password is required and it is entered incorrectly. Provide help to the user to login properly, and optionally offer a link to the home page and/or site map.
403 Access Forbidden. Identify the error, and offer a link to the home page and/or site map.
404 Not found. On a properly-administrated site, you'll never get this except for mis-typed URLs. Identify the error, and offer a link to the home page and/or site map. When you remove a page, set up a 301 to point it to a replacement or similar page. If no such replacement exists, then return 410-Gone, tell the user the page is gone, and offer a link to the home page and/or site map.
410 Resource is gone. On a properly-administrated site, you wont need this one except for stale links that you could not handle with a 301 (see notes on 404 above). When you remove a page, set up a 301 to point it to a replacement or similar page. If no such replacement exists, only then return 410-Gone, tell the user the page is gone, and offer a link to the home page, site map, and/or a similar group of pages.
500 Server error. This means your server is already broken or failing. Use the default Apache error page to keep things simple.
501 Not implemented. The server does not implement the function needed to satisfy the request. I'd ignore this one and just use the default Apache page. Most likely cause for this is a hacking attempt.
502 Bad Gateway. This implies that your server was acting as a gateway or a proxy, something I would not allow. Because of this, fix the problem that allows gateway/proxy use of your server, and just serve the deafult Apache error page.
Jim
...certainly would not try to redirect an Adsense or Adwords click to a different domain. If it's not a violation of their terms or 'quality review,' it should be.
Not sure what you mean about redirecting a click. However, never thought Adsense redirections (in the same category) could be violations. Will check it out. Am wondering why you think it should be a violation?
Is there really anything basically wrong or any negativity in forwarding a non-active domain to a developed site, providing you own both domains and they are in a similar or same category?
For example, you redirect non-active domain examplesitedotorg to your developed site examplesitedotcom. Or redirect domain autoloansdotcom to your autofinancingdotcom website, etc.
Thanks Jim for all the great information. Much appreciated.
One more issue I ask for help on is that even though I am using this "redirect permanent / http:// examplesite dot com/" in my htaccess file my stats report it's all 302 error code traffic and not 301. So wondering why that is not reported correctly or how to correct that? Thanks.
That depends entirely on whether you 'promote' the forwarded domain or not. If you link to it and get others to link to it, and use its URL in Adwords and/or Adsense, then it should be its own site, not a forwarded domain. It is essentially 'duplicate content' as far as search engines and PPC vendors are concerned. The only use for it that they probably wouldn't mind is to capture type-in traffic.
> One more issue I ask for help on is that even though I am using this "redirect permanent / http:// examplesite dot com/" in my htaccess file my stats report it's all 302 error code traffic and not 301. So wondering why that is not reported correctly or how to correct that? Thanks.
I believe I addressed this above in my first post. Did you correct your ErrorDocument directives to use local URL-paths instead of canonical URLs? If so, are you still getting 302s?
Jim
redirect permanent / [example_site.com...]
Doing that with a number of domains and the server stats always report the traffic as being 302 Temporary Redirect, and never 301 for some odd reason. Is it formatted or worded incorrectly?
The restriction on the use of canonical URLs applies only to the ErrorDocument directive, as I believe I have made clear.
A critical question to ask here is *which* server (or domain) is logging the 302 redirects? Following the path starting with a request for a URL which needs to be redirected, what do you see in each server's log along the way? Also, do you use a so-called 'parked domain' or "domain forwarding service" in any part of this setup?
Jim
The reason I want to know is to see how much traffic is coming from the domain name so we can deternine if its worthwhle maintaining the pointer vs. making it a new site.
In other words, when I look at the stats belonging to the site which receives the forwarded visits how can I tell how many site visitors arrived as a result of the Domain Pointer?
Thanks.
it seems a DP is considered a code 200 by the SE
Not sure how this can be...
If a SE is receiving a 200 from the original, 'Pointed' domain, you have duplicated your content and the visitor is staying on the 'Pointed' domain to view the content.
If visitors are 'Forwarded' to another domain, a 200 is *not* a correct response from the original domain and (unless there is a *huge* server config. issue) will not be sent.
The only way I can see for a SE to receive a 200 OK from the domain being pointed is if the user/SE is sent through a 'blind redirect' using a meta-refresh, or equivellent. Using the preceding technique, a user/SE could receive a 200 OK from the original domain on the successful loading of some default page (EG index.php), then using a timed redirect the user/SE would be forwarded to the new domain being pointed at...
As far as your stats go, you will need to check on the original domain (being pointed) and see how many visitors you have. You will then know the visitors have been forwarded to the domain being 'pointed' to and have your count.
Justin
(Not sure which other forum you found helpful, but I would try to avoid too much help from there in the future. =)
Added: I highly recommend reviewing Server Status Codes [w3.org] a Redirect is a 302, Undefined, unless otherwise classified --- There is no 'consideration' by the user, only information sent by the server being requested --- Your server will either send a 301 Permanent, 302 Undefined/Found, OR 307 Temporary code. The user-agent is not given the option of interpretation, regardless of what your hosting company calls their version of 'Forwarding' or 'Pointing'