Forum Moderators: phranque

Message Too Old, No Replies

.htaccess and accessing root folders

can't access root

         

WhosAWhata

7:09 am on Apr 1, 2004 (gmt 0)

10+ Year Member



with this code:

RewriteEngine on 
RewriteCond %{REQUEST_URI}!^(.*/index\.php$¦.*/$)
RewriteRule (.*) index.php?page=$1 [L]
RewriteCond %{REQUEST_URI} ^(/$¦$)
RewriteRule (.*) index.php [L]

the code is in www.site.com/dir/.htaccess

i don't know how to fix this...
www.site.com/dir/
does work
but
www.site.com/dir
doesn't

ukgimp

8:11 am on Apr 1, 2004 (gmt 0)

WhosAWhata

5:29 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



thanks for that, but i couldn't get mod_dir to work

i tried adding it to the top
DirectoryIndex /index.php
RewriteEngine on
RewriteCond %{REQUEST_URI}!^(.*/index\.php$¦.*/$)
RewriteRule (.*) index.php?page=$1 [L]
RewriteCond %{REQUEST_URI} ^(/$¦$)
RewriteRule (.*) index.php [L]

and i tried changing
DirectoryIndex /index.php to
DirectoryIndex index.php

am i doing someting wrong?

WhosAWhata

6:48 pm on Apr 1, 2004 (gmt 0)

10+ Year Member



fixed

RewriteEngine on  
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R,L]
RewriteCond %{REQUEST_URI}!^(.*/index\.php$¦.*/$)
RewriteRule (.*) index.php?page=$1 [L]
RewriteCond %{REQUEST_URI} ^(/$¦$)
RewriteRule (.*) index.php [L]