php - Laravel @ SSL 注册或登录后,用户重定向到站点

标签 php laravel .htaccess ssl laravel-5

很奇怪的问题。一旦我安装了 Lets Encrypt SSL。

在 config/app 设置 URL 为:https://mywebsite

在 layout.blade.view 中将所有设置为 secure_asset(通过 httpS 加载)

如果我关闭 SSL ,那么一切正常

这是我在根目录下的 .htaccess:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
RewriteRule ^(.*)$ public/$1 [L]

这是我在公用文件夹中的 .htaccess

RewriteEngine On
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

问题是,当用户在网站上注册或登录时,用户没有重定向到正确的 URL,而是被重定向到 mysite.com/s

如果我关闭 SSL,那么一切正常,这意味着该代码 100% 正常工作..我说的对吗?

感谢

最佳答案

试试这段代码:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.abc.com [NC]
RewriteRule ^(.*)$ https://www.abcds.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^abc.com [NC]
RewriteRule ^(.*)$ https://www.abcds.com/$1 [L,R=301]

关于php - Laravel @ SSL 注册或登录后,用户重定向到站点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48640608/

相关文章:

php - 管理用户的框架

PHP:goto 和 while 等其他控制结构有什么区别

php - mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row()/mysql_num_rows 等...期望参数 1 是资源

laravel - 如何使用 vue.js 获取多个表单元素的值并将它们发送到 Controller ?

php - MySQL - 基于另一个查询的查询

php - 拉拉维尔 : Query to get a single column in response from a JSON column in mysql 5. 7

php - 如何根据另外两个表的计算从一个表中检索数据?

.htaccess - 如何将所有传入请求重定向到 https?

php - 停止网站目录列表

.htaccess - 在整个站点范围内删除 www,在某些目录上强制使用 https,在其余目录上强制使用 http?