SDaddy
04-25-2003, 12:24 AM
Some Background First: On a website, I have a custom 404 error page via .htaccess, nothing special.
The Problem: That page happens to be appearing far too much
The Reason: The URL Frame automatically generated by the server (a URL Frame allows an input URL through a link or a browser location bar in the form http://site.com/whatever , which opens the real URL location in an invisible frame: http://realsite.com/site.com/whatever . Of course the site.com form looks far better than giving the actual URL, and is shorter too, so it;s much easier for the user to use it and type it.) doesn't work very well and often fails. It just so happens that you never see 404s if you enter in the real URL.
The Compromise: I really don't want to link to the real URL, so I decided whenever a 404 comes up, the user can just click on a link to the real URL and they will be where they want to go.
The Solution: I was thinking that maybe if I could get some JavaScript on the 404 page to read the referrer URL (i.e. in http://site.com/whatever/ form) and alter it to the real URL, which it displays as a link, "were you trying to go here?"
The... Other Problem: I stink at JS and have no idea how. I was told this would be a pretty simple script, but I can't do it.
Can somebody give me a hand?
The Problem: That page happens to be appearing far too much
The Reason: The URL Frame automatically generated by the server (a URL Frame allows an input URL through a link or a browser location bar in the form http://site.com/whatever , which opens the real URL location in an invisible frame: http://realsite.com/site.com/whatever . Of course the site.com form looks far better than giving the actual URL, and is shorter too, so it;s much easier for the user to use it and type it.) doesn't work very well and often fails. It just so happens that you never see 404s if you enter in the real URL.
The Compromise: I really don't want to link to the real URL, so I decided whenever a 404 comes up, the user can just click on a link to the real URL and they will be where they want to go.
The Solution: I was thinking that maybe if I could get some JavaScript on the 404 page to read the referrer URL (i.e. in http://site.com/whatever/ form) and alter it to the real URL, which it displays as a link, "were you trying to go here?"
The... Other Problem: I stink at JS and have no idea how. I was told this would be a pretty simple script, but I can't do it.
Can somebody give me a hand?