Jumpy09 Posted December 18, 2011 Share Posted December 18, 2011 Alright so I have successfully set up a Mod Rewrite that gives clean URLS to everything on the normal scope. This deals with files located in the root directory, but the way I am doing admin pages I am having a bit of a problem getting the rewrite to work right with it. Alright so I call the admin page through http://127.0.0.1/admin/ I want this URL to go to http://127.0.0.1/admin.php which will call files from within the directory of /Admin/ This is what I have in regards to that. RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^admin/$ admin.php From what I understand this should rewrite even if the directory exists, but since I have -Indexes I am receiving a 403 Error ( Access Forbidden ) and if I have +Indexes I get the Admin folder. Is there anything I am missing? This is done on an XAMPP 1.7.7 Setup Apache 2.2.21 ( Win32 ) PHP 5.3.8 Edit: The only thing I can think of is to place a .htaccess file in the directory, but shouldn't the main .htaccess file catch the request even before it gets that far? Edit #2: For my local server I am working in a Sub-Folder so technically it is http://127.0.0.1/Site/admin/ and the rewrite base is /Site. The .htaccess file is located in the /Site/ sub-folder. That slipped my mind. I moved the .htaccess file to the Root Directory but I think I would have to rewrite the rewrite items to make it even rewrite correctly. Quote Link to comment https://forums.phpfreaks.com/topic/253434-rewrite-even-if-the-directory-exists/ Share on other sites More sharing options...
Jumpy09 Posted December 20, 2011 Author Share Posted December 20, 2011 Decided to just change how I had it set up. I have an idea of what the actual problem is, but just changing how everything is set up seems more suited than trying to resolve this issue on my Development set-up. Quote Link to comment https://forums.phpfreaks.com/topic/253434-rewrite-even-if-the-directory-exists/#findComment-1299603 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.