【发布时间】:2012-10-05 14:00:00
【问题描述】:
我的网站上有这段代码,我需要将http://softsolutions.fr 重定向到http://www.softsolutions.fr,但它没有重定向:
<IfModule mod_rewrite.c>
Options +FollowSymlinks
Options +Indexes
RewriteEngine On
RewriteCond %{HTTP_HOST} ^softsolutions\.fr
RewriteRule ^(.*)$ http://www.softsolutions.fr/index.html [R=301,L]
RewriteRule ^$ /index.html [L]
# Rewrites "sub.domain.foo/anything" to "sub.domain.foo/anything.php"
RewriteCond %{REQUEST_FILENAME} !^(.+).php$
RewriteCond %{REQUEST_FILENAME} !^(.+).pdf$
RewriteCond %{REQUEST_FILENAME} !^(.+).(html|htm)$
RewriteRule ^([a-zA-Z0-9\-\_/]*)$ /$1.php [L]
</IfModule>
【问题讨论】:
-
mod_rewrite 是否可用并且 httpd.conf 中的
AllowOverride设置为允许该站点的 .htaccess 重写? -
我是这个问题的新手,我不知道如何确定你问我的问题,你能帮忙,所以我能理解吗?
-
我要问的基本上是,任何重定向都有效吗?