在www.gardening-services-edinburgh.com/index.html
的.htaccess文件中遇到问题目前
我们的.htaccess看起来像
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^gardening-services-edinburgh.com [NC]
RewriteRule ^(.*)$ http://www.gardening-services-edinburgh.com/$1 [R=301,L]
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,R=301]
答案 0 :(得分:0)
尝试以下方法:
Options +FollowSymLinks +Indexes
DirectoryIndex index.html
RewriteEngine On
RewriteCond %{HTTP_HOST} ^gardening-services-edinburgh.com [NC]
RewriteRule ^(.*)$ http://www.gardening-services-edinburgh.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} index\.html$
RewriteRule ^(.*/)?index\.html$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^.+/$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*$ /$0/ [R=301,L]