Setting up for Zend Framework htaccess file

三世轮回 提交于 2019-12-12 01:02:13

问题


That is my project dir:

/webroot
/myproject
    index.php
    /application
    /config
    /library
    /public
        /css
        /img
        /js
        index.php
        .htaccess

That is my code in /myproject/index.php

<?php include 'public/index.php';

Code in .htaccess file:

#SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
RewriteRule !\.(js|ico|gif|jpg|png|css|swf|html|pps)$ index.php [NC,L]

order allow,deny
allow from all

Problem is that I can't load css,img or js files from css,img,js directories.

The requested URL /css/style.css was not found on this server.

回答1:


This is not a htaccess problem. Your DOCUMENT_ROOT should point at your public folder, but it looks like it's currently pointing at your myproject folder (this is a big security hole). You'll probably find that /myproject/css/style.css will work fine. You should update your virtual host settings to fix this.



来源:https://stackoverflow.com/questions/14650507/setting-up-for-zend-framework-htaccess-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!