AdRock Posted August 26, 2006 Share Posted August 26, 2006 I have a folder named admin and when i type in www.mydomain.com/admin it tries to find a page called admin which obvioulsy doesn't existHow do i mod rewrite a rule so it finds the folder [b]admin[/b]?[code]Options +FollowSymLinksRewriteEngine onRewriteBase /RewriteRule ^([A-Za-z0-9]+)/?$ index.php?page=$1 [L]RewriteRule ^([A-Za-z0-9]+)/([0-9]+)/?$ index.php?page=$1&pagenum=$2 [L][/code] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 26, 2006 Share Posted August 26, 2006 If its a folder you should have a forward slash after admin so its like this:mysite.com/admin/if you want to use admin to go to the admin folder then use this:[code]RewriteRule ^admin$ admin/[/code] Quote Link to comment Share on other sites More sharing options...
AdRock Posted August 26, 2006 Author Share Posted August 26, 2006 How would I get it to direct to index.php in the admin folder Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 26, 2006 Share Posted August 26, 2006 It should load up index.php automatically. If your server has had index.php added to the DirectoryIndex directive.If it wasnt configured you might be able to add this to the htaccess file:[code]DirectoryIndex index.php[/code] Quote Link to comment Share on other sites More sharing options...
AdRock Posted August 27, 2006 Author Share Posted August 27, 2006 Which htaccess file do i put that in...the one with the mod rewrite or the htaccess within my admin folderAlso how do I mod rewrite for a page such as [b]change-password.php[/b] ??? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 28, 2006 Share Posted August 28, 2006 You put it in the htaccess file that is in the root of your websites folder you upload your files to. Quote Link to comment Share on other sites More sharing options...
AdRock Posted August 28, 2006 Author Share Posted August 28, 2006 I put it in both htaccess files but it doesn't work.When i type in [b]www.mysite.com/admin/[/b] it asks for my username and password from the htaccess file so i know it works but it's not opening index.php. It will if i add index.php at the end but no on its own 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.