【发布时间】:2021-05-31 13:14:33
【问题描述】:
我正在尝试重定向到 https,然后是子文件夹。
在我连接到移动数据并清除浏览器/cookie 之前,它在我的 iPhone 上运行良好。然后我从谷歌搜索中的链接中得到连接超时或服务器停止响应错误。如果我重新连接到家庭/办公室 Wi-Fi 并且站点从相同的链接加载而没有问题。主站点在一个文件夹中。
我在 htdocs/htaccess 和 index.php4 文件中有以下代码
htaccess 文件 - 强制所有页面使用 https
RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
htdocs/index.php4 文件 - 将主域重定向到子文件夹
<meta http-equiv="refresh" content="0; url=http://sundenmanagement.com/home1/index.php">
任何帮助将不胜感激!
【问题讨论】:
-
为什么元刷新再次显式使用 HTTP URL?假设我首先访问
http://sundenmanagement.com/,然后您首先将我重定向到该版本的 HTTPS 版本,然后将我从那里重定向到http://sundenmanagement.com/home1/index.php,然后再次重定向到其 HTTPS 版本。 -
您好,我已经尝试了两种方式,目前是 https,然后我还尝试了 php 重定向。我认为这可能与 joomla 网站有关,因为如果我输入我想要的地址,我会得到相同的结果。
<!DOCTYPE html> <html> <head> <?php header("Location: https://sundenmanagement.com/home1/index.php"); exit; ?> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="refresh" content="0; url=https://sundenmanagement.com/home1/index.php"> </head> <body> </body> </html> -
在使用蜂窝数据时,网站本身似乎存在问题。如果我去
https://sundenmanagement.com/home1/index.php网站仍然无法加载然后我重新打开我的 wifi 并加载网站...... ?? -
也许您的手机提供商有 DNS 或路由问题?尝试验证 DNS 查找是否有效,并查看 traceroute 显示的内容。
-
现在我尝试将 MySQL 更新到 5.6 并破坏了它,不会加载任何东西。持有provider可以放回5.0。新的 joomla 安装也不会运行。
标签: php .htaccess redirect url-rewriting http-status-code-301