Shilo Posted November 30, 2008 Share Posted November 30, 2008 To start off with my problem I will give you some code: .htaccess: ErrorDocument 403 /index.php?status=403 ErrorDocument 404 /index.php?status=404 and the code of the /index.php?status=403: <?php case "403": $titleE = "403 Error - Forbidden"; $messE = " :: You do not have access to this area!"; $error = $bst.$titleE.$messE.$ben; break; ?> This works fine and displays "403 Error - Forbidden :: You do not have access to this area!" and shows it in an error box with the default homepage. now heres the problem. It displays "localhost/require/" at the top of the page. This is because I was trying to access the "require" directory of my website. but when I click on a new link I get this error: See the problem. Its trying to find file "localhost/require/index.php?blablabla..." is there a way to make the htaccess direct the page to index.php?status=403 but in the root directory and not the require directory? Quote Link to comment Share on other sites More sharing options...
Shilo Posted November 30, 2008 Author Share Posted November 30, 2008 what I think I need to do is make the htaccess file look like: ErrorDocument 403 %{HTTP_HOST}^/index.php?status=403 or something. but I cant seem to find the function for the root of the website. Quote Link to comment Share on other sites More sharing options...
laPistola Posted November 30, 2008 Share Posted November 30, 2008 The true error url isn't shown its masked by the url the error was generated it so the error page is in the root directory and called from in there by putting ErrorDocument 403 /index.php?status=403 you are saying the document for error 403 is in the / root to where ever that htaccess is the other option is if your htaccess isn't in your root http folder to define the full http path (which really you only need the main htaccess file in the root, any other htaccess files in other directorys should really be small situration changes) ErrorDocument 403 http://mysite.com/index.php?status=403 Quote Link to comment Share on other sites More sharing options...
Shilo Posted November 30, 2008 Author Share Posted November 30, 2008 The true error url isn't shown its masked by the url the error was generated it so the error page is in the root directory and called from in there by putting ErrorDocument 403 /index.php?status=403 you are saying the document for error 403 is in the / root to where ever that htaccess is the other option is if your htaccess isn't in your root http folder to define the full http path (which really you only need the main htaccess file in the root, any other htaccess files in other directorys should really be small situration changes) ErrorDocument 403 http://mysite.com/index.php?status=403 Are you serious?! Thats all I had to do. Grr. I cant thank you egnouph man! Have a good night. TOPIC SOLVED! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.