A friend of mine wants to know about redirecting pages and how this works with Google Analytics please.
I have another question in the coding and databases section covering this redirecting part - other question
He would like to know if the pages are being redirected then which pages does he need to put the Google Analytics code on please, either on the error code ASP page or the redirected default.asp page?
If you are using 404 errors and associated redirects to scripts to serve content then you are playing with fire.
Those scripts are dirty kludges that break the HTTP specifications. They were developed back in the day when some servers had limited features and people got a bit "inventive" with ways to circumvent that.
If I request a URL that should directly serve content, then that content should be returned with a "200 OK" response in the HTTP header.
There should be no other codes, or redirects involved. You often see redirects involving a 302 or 404 to a script, which then serves content with a 200 OK. That is a thoroughly broken system.
My advice: stop now. You are heading in the wrong direction.
>>If you are using 404 errors and associated redirects to scripts to serve content then you are playing with fire.
Actually serving content this way need not result in a redirection.
It is highly convoluted - but many sites do that with aplomb. You have to create an "engine" which is triggered by the non existing URL. But before the server sends the 404 status code, it runs the engine which looks for the pattern in the supplied URL and extracts the content from a database. The eventual end user - the browser sees a standard 200 status code. No one will know that such a URL never existed physically in the server.
It doesn't break any HTTP specification at all if it is done the right way. It doesn't create any more infinite duplicate content than the "regular" dynamic pages. Trust me - I have been doing this for years. It is not a kludge.
It is just another way to extract parameters from the URL.
Only thing is there is no directory as Sony or mobile-phones or Z550i. The server finds that there are no such directories or files and passes on the error trapping to another module for further processing.
I have to admit, the sites I look after all use a similar structure to what Prowler says. However doing things this way, you need to lock down as much as possible, if the search engines catch even a glimpse of the original URL then it's duplicate content hell.
If your going to use a 404 thing to redirect your pages so they have pretty URL's, be extremely paranoid of how the search engines can find the 'original' pages.
The key here is you must have a very good 'system' in place to handle this technique. It is not just a matter of setting up a few directives in a .htaccess .
Again the browser doesn't see a 404 unless it is deliberate. There are no original URLs here - remember we are talking about non existant files here.
You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
You have not yet logged in, or registered properly as a member
You are a member, but no longer have posting rights.
This is a private forum, for which you do not have permissions.
If you are a recent member, it's possible that you simply have not yet confirmed your account. Please
check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions
contained within.
If you are still experiencing problem, please read the
Login Assistance
Article for some advice on what may be causing your login not to work properly.