1

我正在进行项目维护,我需要配置 htaceess 文件以在 localhost 上运行项目,因为我已经创建了一个虚拟主机来运行该项目。

我有以下代码 -

RewriteEngine On
Options +FollowSymlinks
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{HTTPS} on
RewriteRule ^(?!(text1|text2|text3)\.html|common-secure\.php|images\/|css-secure\/|javascript\/).* http://%{HTTP_HOST}%{REQUEST_URI} [R=301]

RewriteRule ^index.(.*)\.html$ index.php?langurl=$1&%{QUERY_STRING}
RewriteRule ^index.html$ index.php?%{QUERY_STRING}
RewriteRule ^city/(.*)\.(.*)\.(.*)\.html$ city.php?cityurl=$1&langurl=$2&page=$3&%{QUERY_STRING}


#Other rules

我通过以下替换了上面最后的第 4 行和第 5 行 -

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

但是,仍然无法加载 js 插件。此外,没有将查询字符串参数(如“langurl”)放入 $_GET。

我在这里错过了什么/出了什么问题?

谢谢。

4

1 回答 1

1

您缺少在其中添加网站目录RewriteBase

RewriteBase /projectfolder/
于 2013-10-07T12:58:05.750 回答