[英]Laravel: www redirection to non-www returns 404 on http
我在 DigitalOcean 上托管了我的 Laravel 应用程序(安装了 Apache 的 Ubuntu 20.04)。 我需要将 www 域重定向到启用了 SSL (HTTPS) 的非 www 域。 但是,当我尝试 go 到www.example.com
时,它返回 laravel 404 错误页面。
When I try to write the same www.example.com
but starting with HTTPS ( https://www.example.com
) it redirects successfully to non-www. 唯一的问题是当我尝试 go 到www.example.com
时它显示错误。
这是我的.htaccess
:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www.dukabox.com$ [NC]
RewriteRule ^(.*)$ https://dukabox.com/$1 [R=301,L]
任何建议都会有所帮助
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.