我在做下面的设置时想做什么时遇到问题。删除www和重定向index.html的一些问题.html
我想删除所有WWW,并将index.html转发到根目录。我希望这是为所有域,所以我在做httpd.conf目录指令。
我尝试了许多变化没有成功。最新版本如下(域位于/ var/www/html中,位于单独的目录中)。
http://www.example.com/index.html > http://example.com
http://www.example.com/someother/index.html > http://example.com/someother/
感谢,
玛丽亚
<Directory "/var/www/html/*/">
RewriteEngine on
RewriteBase/
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
#RewriteCond %{REQUEST_URI} /^index\.html/
RewriteRule ^(.*)index\.html$/[R=301,L]
Options ExecCGI Includes FollowSymLinks
AllowOverride AuthConfig
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我得到:http://example.com//var/www/html/example当我要求http://www.example.com/index.html时 – MariaKeys 2010-10-17 16:09:53