使用htaccess重定向URL
问题描述:
我使用下面的代码,如果有一个子文件/文件夹,例如, domain.com/home.html使用htaccess重定向URL
的问题是,如果我刚刚访问domain.com,它试图重定向到domain.com/index.html.var
RewriteOptions inherit
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ "http://www.domain.com/$1"
答
尝试使用的DirectoryIndex htaccess的指令
DirectoryIndex index.html home.html
这是哪里的.htaccess位于,为什么你'RewriteOptions inherit'? – anubhava
这是网站的主文件夹。不知道继承的东西。 –
注释掉'RewriteOptions inherit'行。您的根文件夹是否有索引文件? – anubhava