php - htaccess redirects unexpectedly to folder -


i have strange me problem. i'm developing zend framework application , have file structure:

/ /application/ /public/ /public/.htaccess /public/index.php /public/js/ /public/style/ /public/profile/ /.htaccess 

my domain point folder /

when enter address example.com/profile/ goes controller profile , good. when enter address example.com/profile server redirects me to: example.com/public/profile/

i have solution whenever request: example.com/profile/ or example.com/profile

the same page rendered second version gives me redirect , don't know why.

the /.htaccess file is:

rewriteengine on rewriterule ^(.*)$ public/$1 [l] 

the role of file route traffic / /public without redirects.

the /public/.htaccess file is:

rewriteengine on rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] 

can me this? thanks.


i fixed this. here solution if have same problem: fix have set following options , disable directoryslash

options -indexes followsymlinks directoryslash off 

now apache shouldn't add trailing slashes @ end of uri when pointing directory. disable redirect uri trailing slash.

optionally match last /. change .htaccess file this:

rewriteengine on rewriterule ^(.*)/?$ public/$1 [l] 

Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

c# - SharpSVN - How to get the previous revision? -

php cli reading files and how to fix it? -