Good Morning, and Happy New Year to everyone...

I have a membership website that I have been developing, and am looking for a way to do something different with the ErrorDocument 404 that I have set in the .htaccess file.

Not 100% sure this is what is necessary, but hopefully someone here can give me a suggestion as to the best route to take.

Here is what it is:

The site has an ad directory for member to member advertising, which has primary categories, and sub categories, and the ads can be placed directly under either one. When you click on an ad, it opens in a new window, and I have removed all navigation from within that page, so they don't end up with multiple occurrences of the primary website. That way when they close the ad or the resulting website linked, they will be back on the ad directory...

Anyway, it all works great except for if the link in the ad is bad, when you click on it, it follows the 404 doc that is set up in the .htaccess, and takes them back to the main web page with navigation, etc. in place, thereby creating the second occurrence of the website that I am trying to avoid.

Long story short (finally), How can I separate this ad display page from the site completely, and still carry the session variables with me?

My first thought is to change where the 404 is redirected just for this page, and just re-direct it to itself, thus no duplication of the base website.

Any suggestions on how to accomplish this, and/or on any better approach to resolving this issue.

Thanks in advance for your thoughts, ideas, suggestions, comments, and basically for your time.

Have a very happy new year...

Douglas

    i would ensure the link in the ad is not bad, solve the disease rather than the symptom

      If your 404 error document is a PHP script, you can use the value of $SERVER['REQUEST_URI'] (or $SERVER['REDIRECT_URL'] and $_SERVER['REDIRECT_QUERY_STRING']) to determine what URL caused the 404 error and thus handle the ad URLs differently.

      Note that the above may not be applicable if PHP was integrated with Apache as a CGI binary (I don't have such a setup to test this theory at the moment).

        dagon;10971536 wrote:

        i would ensure the link in the ad is not bad, solve the disease rather than the symptom

        The issue with that is that it is an ad directory, and while we can monitor new ads as they come in for good links, there is nothing saying that the link will still be good tomorrow... Wish it were that simple

          bradgrafelman;10971538 wrote:

          If your 404 error document is a PHP script, you can use the value of $SERVER['REQUEST_URI'] (or $SERVER['REDIRECT_URL'] and $_SERVER['REDIRECT_QUERY_STRING']) to determine what URL caused the 404 error and thus handle the ad URLs differently.

          Note that the above may not be applicable if PHP was integrated with Apache as a CGI binary (I don't have such a setup to test this theory at the moment).

          That sounds like an intelligent approach to this matter... Thanks for the response, I will work on it from that angle and see what I can come up with.

            I am going to mark this thread solved... I haven't actually gotten the issue fixed, but am tied up with other aspects of the program, and won't get back to this for several day...

            Thanks for the responses, and when I actually get it worked out, I will post the results here..

              showman13;10971563 wrote:

              The issue with that is that it is an ad directory, and while we can monitor new ads as they come in for good links, there is nothing saying that the link will still be good tomorrow... Wish it were that simple

              You could check they stay good a number of ways, your call of course

                Write a Reply...