Jump to content

How to access folder with mod rewrite


AdRock

Recommended Posts

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 exist

How do i mod rewrite a rule so it finds the folder [b]admin[/b]?

[code]Options +FollowSymLinks
RewriteEngine on
RewriteBase /
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]
Link to comment
https://forums.phpfreaks.com/topic/18732-how-to-access-folder-with-mod-rewrite/
Share on other sites

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]
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.