簡體   English   中英

設置Zend Framework htaccess文件

[英]Setting up for Zend Framework htaccess file

那是我的項目目錄:

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

那是我在/myproject/index.php中的代碼

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

.htaccess文件中的代碼:

#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

問題是我無法從css,img,js目錄加載css,img或js文件。

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

這不是htaccess問題。 您的DOCUMENT_ROOT應該指向您的公用文件夾,但是看起來它當前正在指向您的myproject文件夾(這是一個很大的安全漏洞)。 您可能會發現/myproject/css/style.css可以正常工作。 您應該更新虛擬主機設置以解決此問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM