【发布时间】:2014-09-05 13:03:02
【问题描述】:
我的网站有以下文件夹结构:
index.php
.htaccess
public_html/css/* (css files)
public_html/images/* (image files)
public_html/js/* (javascript files)
子文件夹 public_html 中的所有静态文件都链接到我的页面文件中,而没有 public_html:例如/images/logo/logo.png
我设置了以下 .htaccess 文件,该文件在我的本地 apache 和我的网站空间上运行良好,但在客户的网站空间上,它无法正常工作:
RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/public_html/%{REQUEST_URI} -f
RewriteRule ^(.*)$ /public_html/$1 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond ${REQUEST_URI} ^/public_html/
RewriteRule .* - [L]
RewriteRule ^ index.php [QSA,L]
【问题讨论】:
标签: apache .htaccess mod-rewrite