mintoo2cool Posted August 21, 2011 Share Posted August 21, 2011 How to configure the server to restrict a user from accessing the directory structure, by changing the URL? for example: if the server redirects the user to the following URL upon successful login. http://mysite/dir1/dir2/dir3/phpfile.php currently, if i try change the URL to http://mysite/dir1/ even though there is no index webpage for dir1/, the directory structure gets exposed. how do i go about restricting the user from accessing the directory structure and throw an error message at him like "you are not authorised to view this", whenever a "smarty-pants" user tries to edit the URL manually. The user should only be able to see the webpages which the server redirects him to. nothing else. How to configure the PHP server such that, if the URL is modified manually, server should redirect to an error page instead of exposing the directory structure. Quote Link to comment https://forums.phpfreaks.com/topic/245375-how-to-restrict-a-user-from-accessing-directory-structure-by-changing-the-url/ Share on other sites More sharing options...
JKG Posted August 21, 2011 Share Posted August 21, 2011 hows about using .htaccess rewrites instead of actual directories? Quote Link to comment https://forums.phpfreaks.com/topic/245375-how-to-restrict-a-user-from-accessing-directory-structure-by-changing-the-url/#findComment-1260248 Share on other sites More sharing options...
bspace Posted August 23, 2011 Share Posted August 23, 2011 you need to look at using a htaccess file see for example: http://corz.org/serv/tricks/htaccess.php Options -Indexes will do the trick Quote Link to comment https://forums.phpfreaks.com/topic/245375-how-to-restrict-a-user-from-accessing-directory-structure-by-changing-the-url/#findComment-1260735 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.