【发布时间】:2014-01-19 06:33:59
【问题描述】:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.example\.am [NC]
RewriteRule ^(.*)$ http://example.am/$1 [L,R=301]
</IfModule>
为什么不行,我在/etc/httpd/conf/http.conf最后加上了,我确定了
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory "/var/www/html">
是因为我的网站在 /srv/www/domain/public_html 中吗?
【问题讨论】:
-
您的网站是 www.example.am,并在其 vhost 定义中如此定义?
-
不,我把我的网址拿出来了,但我以前有我的网址,它仍然不起作用?
-
也许 mod_rewrite 没有加载?不要像这样使用 IfModule!
标签: php apache mod-rewrite vps