Page 1 of 1

help, htaccess

PostPosted: Sun Jun 03, 2012 12:40 pm
by anggit
hi, i try a mod rewrite in htaccess like this:
http://localhost/any -> http://localhost/any.php
but now the problem is i'm unable to access any directory, since http://localhost/directory will mod to http://localhost/directory.php.
any idea? :?

Re: help, htaccess

PostPosted: Mon Jun 04, 2012 1:41 am
by Max
Can't really help you unless you actually post your .htaccess file :P

Also just quickly, will it work if you put another slash after the directory?

Re: help, htaccess

PostPosted: Mon Jun 04, 2012 12:07 pm
by anggit
not work too, here is my .htaccess:
Code: Select all
RewriteRule ^([-0-9a-z]+)/?$ $1.php [NC,L]

as i said before, then my main problem is i'm unable to access my files :x

thank you, :idea: i think the problem was fixed by adding a conditional in htaccess, then it would be like this:
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([-0-9a-z]+)/?$ $1.php [NC,L]


\ :D /

Re: help, htaccess

PostPosted: Tue Jun 05, 2012 3:38 am
by Max
It's all good now then?