Zend Framework on shared hosting

后端 未结 12 1463
孤独总比滥情好
孤独总比滥情好 2020-12-04 17:01

I\'m new to Zend Framework. I would like to know how to implement zend framework on a shared hosting. Because of the zend framework folder structure all view files are put i

12条回答
  •  不知归路
    2020-12-04 17:35

    Include this .htacces file under your base path (that is /../public):

    RewriteEngine On
    
    # Exclude some directories from URI rewriting
    #RewriteRule ^(dir1|dir2|dir3) - [L]
    
    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 leave the .htaccess that was under the publc directory where it was.

    So you will have 2 .htaccess files, one under the public directory (the ordinary one from Zend Framework documentation) and second one under your base path (the one I posted above).

提交回复
热议问题