Jump to content

.htaccess Help With Redirecting


sooty2006
 Share

Recommended Posts

im trying to log infomation from a 403 errorthere are files i dont not want users to access,so when they visit the url it gives a 403 forbidden error.but i want to make a log of the pages that are trying to be visited and there ip is there any way of posting DOCUMENT_ROOT & REMOTE_ADDR using the .htaccess?if not is there any other way?many thanks scott.

Link to comment
Share on other sites

i have my own custom made error files but when i request the DOCUMENT_ROOT & REQUEST_URI on that php page it redirects to, it shows that page i want it to show the file it came from.ie. error 403 custom file is httpdocs/e_handler/403.phpsay i accessed: httpdocs/_dir/_config/functions.phpwhen it redirects to the 403.php file and try to get the accessed folder name it returns the e_handler folder..is there a way i can post the DOCUMENT_ROOT to the custom made 403 error?thanks.

Edited by Scott Milner
Link to comment
Share on other sites

i have my own custom made error files but when i request the DOCUMENT_ROOT & REQUEST_URI on that php page it redirects to, it shows that page i want it to show the file it came from.ie. error 403 custom file is httpdocs/e_handler/403.phpsay i accessed: httpdocs/_dir/_config/functions.phpwhen it redirects to the 403.php file and try to get the accessed folder name it returns the e_handler folder..is there a way i can post the DOCUMENT_ROOT to the custom made 403 error?thanks.

Link to comment
Share on other sites

The only way I can see to do this is to add something like this to the functions.php page:$_SESSION['document_root'] = $_SERVER['DOCUMENT_ROOT'];As far as I know, there's no way to get the DOCUMENT_ROOT of the HTTP_REFERER. I could be wrong, but that's just based off of what I know.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...