php - Redirect to public folder when using ZF2 -


i'm using zf2 (zend framework 2, v2.2) , http://www.foo.com/path/to/app/ redirect public folder.

i've tried lot of solution not of them allow url point /path/to/app/public/index.php, while displaying /path/to/app/.

i appreciate solution cannot create virtual host described in app skeleton readme file.

any appreciated.

cheers, greg.

i figured out solution: https://github.com/gpfister/zendskeletonapplication

in short, added .htaccess file @ root of application:

rewriteengine on  # if url application http://foo.com/path/to/zendskeletonapplication/ # set base /path/to/zendskeletonapplication/ rewritebase /path/to/zendskeletonapplication/  rewriterule ^\.htaccess$ - [f] rewritecond %{request_uri} ="" rewriterule ^.*$ public/index.php [nc,l]  rewritecond %{request_uri} !^/public/.*$ rewriterule ^(.*)$ public/$1  rewritecond %{request_filename} -f rewriterule ^.*$ - [nc,l]  rewriterule ^public/.*$ public/index.php [nc,l] 

and changed module/application/config/module.config.php.

it working fine, though http://foo.com/path/to/zendskeletonapplication/public fail, fine don't plan access app url.

hope helps.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -