我的.htaccess文件沒有被讀取,我已經把在/ var .htaccess文件/ www/html等含有.htaccess文件沒有被讀取
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
然後我的http.conf文件的樣子這
ServerRoot "/etc/httpd"
<Directory />
AllowOverride none
Require all denied
</Directory>
DocumentRoot "/var/www/html"
<Directory "/var/www">
AllowOverride None
# Allow open access:
Require all granted
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
我要訪問
和文件是我的/ var/www/html等文件夾,但是當我試圖訪問它形成另一個服務器我不斷收到此錯誤
Image from origin 'http://serverB' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://example.com' is therefore not allowed access.
爲什麼我的.htacces文件沒有被讀取,我怎樣才能讓它被讀取?
謝謝
'ls -l'會顯示文件權限,也許會有線索。 – 2015-12-07 04:20:47
@ESYSCODER這列出了我的根目錄中的文件的權限我不知道這有什麼幫助? – iqueqiorio 2015-12-07 04:27:18
我在想你會把它的結果添加到答案中。 .htaccess是否允許Apache讀取它?用戶/組匹配apache進程用戶/組? – 2015-12-07 04:31:17