How to remove “public” from url using routeing in zend framework

前端 未结 3 592
我在风中等你
我在风中等你 2021-01-07 09:19

An one issue in my zend, i write rule in .htaccess to remove \"public\" from url as following,

--------------------------------------------------------------         


        
3条回答
  •  囚心锁ツ
    2021-01-07 09:52

    Yes, and you don't need Zend_Route. Delete the public folder and put the Zend Framework files from it (index.php, .htaccess, etc) in your root directory (e.g. htdocs). You can place the application folder and other Zend Framework files outside of your web root where they cannot be accessed over HTTP.

    All you need to do is edit index.php and change the APPLICATION_PATH to the correct path. This way your Zend Application will run from your root directory and you won't need to use mod_rewrite to hide the public folder.

    See the last part of this answer for a similar example.

提交回复
热议问题