.htaccess - 我的网站无故转发到 /public_html
问题描述
前段时间我想将我的网站从 http:// 转发到 https:// 我用一些代码编辑了 .htaccess 文件,但它不起作用,我删除了 .htaccess。现在,没有 .htaccess 文件,它会自动重定向到 /public_html/ 文件夹。请帮忙,谢谢。
解决方案
使用示例重写创建 .htaccess 文件并检查它是否有效
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
推荐阅读
- python - 如何使用 .keys() 删除重复行并在数据帧字典中保持第一?Python - 熊猫
- exe - 如何访问 Zip 文件中的 NSIS 安装程序目录以提取该 Zip 文件?
- excel - 将字段从 VB.NET 导出到 .XLSX
- hadoop - 复制因子的 HDFS 机架感知策略,而不是默认复制因子,即 3
- r - ggplot2:用图例制作多行+丝带
- python - 为什么我在 C# 和 Python 中得到不同的结果
- c# - 使用电子表格创建场景映射并引用相邻单元(场景)
- java - 有没有办法从java中的LocalDate计算最小值?
- oauth-2.0 - Microsoft Identity 平台方案中 access_token 和 refresh_token 的大小是多少,如果合理,是否应将其存储在 DB 中?
- delphi - 使用 Stretch 在 TImage 中获取鼠标下的像素。Proportional 和 Center 都设置为 true