apache - .htaccess not working with some PHP files -
i have .htaccess
file wont find php
files find others. example,
rewriterule ^test$ test.php
will give 404 not found
rewriterule ^custom$ test.php
will work.
its same rule add .php end of url. ideas?
full file
rewriteengine on rewriterule ^test$ test.php #doesn't work rewriterule ^custom$ test.php #works
full directory(ls -a)
. .. .htaccess index.html test.php
thanks.
make sure multiviews
off it's not causing funny business trying match files. always use [l]
stops processing rules when rule met. can cause issues down line continuing run other rules. should not matter if have trailing slash or not. measure can check conditions if it's not real file or not real directory process rule , won't 404.
options -multiviews rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^test/?$ test.php [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^custom/?$ test.php [l]
Comments
Post a Comment