.htaccess - 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]
解决方案
推荐阅读
- regex - 从 PHP 到 JS 的正则表达式
- android - 为什么使用 Retrofit Multipart 上传时图像没有显示在服务器上?
- google-chrome - 即使在对该资源使用“预连接”资源提示后,Chrome 的网络日志也会显示资源请求的“is_preconnect=false”
- excel - 命名工作表上的行删除
- css - 如何使用css在django模板中更改颜色n次?
- teradata - 从选择中覆盖 Teradata 表分区
- json - Kafka 到 presto 查询原始 json 主题
- jsp - 为什么 JSTL(1.0) 函数 taglib 在 jsp 中不起作用
- sql - 如果它们满足不同的条件,则选择两个不同的项目
- android - Android dex2oat build:ERROR: Dex2oat failed to compile a boot image