ush
04-29-2003, 06:23 PM
Hello!
[1]
In my custom 404 page (which can't use PHP, CFM, ASP, etc.) I'd like to give the user a chance to visit 'one level up'. I can't do this with a link to "../" as the 404 page has a BASE HREF="http://www.thegrid.org.uk/" tag in the HEAD of the document so that the images, css, etc, will always work, no matter what the current URL of the missing document is...
So what I need to do is strip off everything after the final "/" (using reg exps?) and offer that as a "try this link and see if it works!" link on my page....
So:
if the URL is http://www.thegrid.org.uk/foo/bar/foo.html
I'd like to offer the user http://www.thegrid.org.uk/foo/bar/ as a link to try.
[2]
Ideally, if the address was http://www.thegrid.org.uk/foo/bar/foo.html I'd like to offer them a choice of
http://www.thegrid.org.uk/foo/bar/
http://www.thegrid.org.uk/foo/
http://www.thegrid.org.uk/
so that they can *definitely* find a page that works, but that's out of my range using JS - isn't it?
Any tips welcome and greatly appreciated!
ian.
[1]
In my custom 404 page (which can't use PHP, CFM, ASP, etc.) I'd like to give the user a chance to visit 'one level up'. I can't do this with a link to "../" as the 404 page has a BASE HREF="http://www.thegrid.org.uk/" tag in the HEAD of the document so that the images, css, etc, will always work, no matter what the current URL of the missing document is...
So what I need to do is strip off everything after the final "/" (using reg exps?) and offer that as a "try this link and see if it works!" link on my page....
So:
if the URL is http://www.thegrid.org.uk/foo/bar/foo.html
I'd like to offer the user http://www.thegrid.org.uk/foo/bar/ as a link to try.
[2]
Ideally, if the address was http://www.thegrid.org.uk/foo/bar/foo.html I'd like to offer them a choice of
http://www.thegrid.org.uk/foo/bar/
http://www.thegrid.org.uk/foo/
http://www.thegrid.org.uk/
so that they can *definitely* find a page that works, but that's out of my range using JS - isn't it?
Any tips welcome and greatly appreciated!
ian.