【发布时间】:2015-03-28 07:31:00
【问题描述】:
我在tomcat(通过mod_jk)前使用apache 2.2.9,它有一个ROOT文件夹和webapp下的一些.html文件。
我默认配置 URL 重写:
<VirtualHost *:80>
<IfModule mod_rewrite.c>
RewriteLog /var/log/apache2/rewrite.log
RewriteLogLevel 3
</IfModule>
ServerAdmin webmaster@localhost
ServerName www.megamadz.com
ServerAlias megamadz.com
DocumentRoot /usr/tomcat/webapps
JKMount /* ajp13_worker
...
AllowOverride All
我将 .htaccess 放在 webapps 和 ROOT 下,但是 rewrite.log 的输出为 0,无论我在浏览器中输入什么,http://mydomain/about-us 它都说 ... 不可用,它从不指向 http://mydomain/about-us.html
这是我的 .htaccess 文件:
RewriteEngine On # Turn on the rewriting engine
RewriteRule ^about-us$ about-us.html [NC,L]
【问题讨论】:
-
你可以试试
RewriteRule ^/about-us$ about-us.html [NC,L] -
Same, 404, 0 rewrite.log, 这里是.htacess: RewriteEngine On # 开启重写引擎 RewriteRule ^/about-us$ about-us.html [NC,L] RewriteRule ^ /advertising$ ads/advertising.html [NC,L] RewriteRule ^marketing$ marketing/marketing.html [NC,L] RewriteRule ^advertising-platform?$advertising-platform/advertising-platform.html [NC,L]跨度>
-
rewrite.log 里有没有录入?
-
不,0字节,不知道怎么回事。
-
你能尝试在你的 http.conf 中添加命令吗(不是在 .htaccess 中)?
标签: apache tomcat configuration