首页 > 解决方案 > htaccess 重定向只显示 index.html

问题描述

我有一个为几个小站点划分的主机,每个站点都有自己的域。主域停在“主”文件夹中,但它只允许我输入 index.html 这是我的 htaccess 文件:

 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}}

 RewriteCond %{HTTP_HOST} ^(www.)?siteurl\.com\.cl$ [OR]
 RewriteCond %{REQUEST_URI} !^/main/ 

 RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d 

 RewriteRule ^(.*)$ /main/ 
 RewriteCond %{HTTP_HOST} ^(www.)?siteurl\.com\.cl$ [OR]
 RewriteRule ^(/)?$ main/ [L]

标签: .htaccessredirecthosting

解决方案


推荐阅读