Author |
|
Mark1979
Joined: 21 Jun 2010 Posts: 3
|
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 21 Jun '10 16:01 Post subject: |
|
|
I think a custom error handler for that folder could be a solution. Maybe a server side script which handles 404 errors and than redirects to the new folder.
e.g
Code: |
ErrorDocument 404 /banners/my_404_handler.php
|
|
|
Back to top |
|
Mark1979
Joined: 21 Jun 2010 Posts: 3
|
Posted: Mon 21 Jun '10 16:07 Post subject: |
|
|
Hey James,
Thanks for the quick response, that does sound like a good option. |
|
Back to top |
|
Mark1979
Joined: 21 Jun 2010 Posts: 3
|
Posted: Mon 21 Jun '10 16:32 Post subject: |
|
|
Hmm, that doesnt seem to work either.
It seems that HTTP_REFERER doesn't work for 404's - or I can't get them to work anyway. the Http referer just shows my_404_handler.php as the referring page. |
|
Back to top |
|
glsmith Moderator
Joined: 16 Oct 2007 Posts: 2268 Location: Sun Diego, USA
|
Posted: Mon 21 Jun '10 23:04 Post subject: |
|
|
For the ErrorDocument route ... is FileInfo one of the AllowOverrides for the folder or folder/s above it in the tree? The only reason I cannot think of that it would not work as this is a pretty standard way to serve up custom error documents. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7371 Location: Germany, Next to Hamburg
|
Posted: Mon 21 Jun '10 23:07 Post subject: |
|
|
You are using the wrong variable Try $_SERVER['REQUEST_URI']
---- edit ---
There are two different variables that I find very useful in Caching and similar.
$_SERVER['REQUEST_URI'] and $_SERVER['REQUEST_URL']
URI provides the entire request path (/directory/file.ext?query=string)
URL provides the request path, without the query string (/directory/file.ext)
It also differs from __FILE__ in that it's not the file name. So, if you go to /directory/anotherfile.ext and get silently redirected to file.ext, these variables are anotherfile.ext, while __FILE__ is still file.ext. |
|
Back to top |
|