简体   繁体   English

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

[英]Laravel @ SSL after registration or login, user redirected to site/s

Very strange issue. 非常奇怪的问题。 Once I install Lets Encrypt SSL. 一旦我安装了Lets Encrypt SSL。

in config/app set URL as: https://mywebsite 在config / app 中将URL设置为: https:// mywebsite

in layout.blade.view set all as secure_asset (to load over httpS) 在layout.blade.view中全部设置为secure_asset (以通过httpS加载)

If I turn off SSL , then everything is OK 如果我关闭SSL,那么一切都OK

Here are my .htaccess in root : 这是我的.htaccess根目录:

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

And here is my .htaccess in public folder 这是我在公用文件夹中的.htaccess文件

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

Problem is, when user is registered on website or logged in, then instead of redirecting to proper URL, user is redirected to mysite.com/s 问题是,当用户在网站上注册或登录时,然后将用户重定向到mysite.com/s而不是重定向到正确的URL

If I turn OFF SSL, then everything is OK, so it means, that code is 100% working and fine.. am I right? 如果我关闭SSL,则一切正常,这意味着该代码可以100%正常工作。.是吗?

Thnx 日Thnx

Try this code: 试试这个代码:

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]

找到解决方案:我清除了一个缓存,这个问题消失了

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM