Php 未找到来自AWS的带有HTTPS的Laravel路由
我刚刚通过AWSACM和ELB将我的HTTP升级到HTTPS。 我的文件夹结构是这样的Php 未找到来自AWS的带有HTTPS的Laravel路由,php,apache,laravel,amazon-web-services,https,Php,Apache,Laravel,Amazon Web Services,Https,我刚刚通过AWSACM和ELB将我的HTTP升级到HTTPS。 我的文件夹结构是这样的 htdocs- -index.html -myproject(laravel starts here) -index.php -folder(it contains config and all other folders) 现在,如果没有HTTPS重定向代码,它可以完美地工作, 但当我添加AWS ACM提供的代码时,我的登录页就完美了,但下一个路径给出了404错误
htdocs-
-index.html
-myproject(laravel starts here)
-index.php
-folder(it contains config and all other folders)
现在,如果没有HTTPS重定向代码,它可以完美地工作,
但当我添加AWS ACM提供的代码时,我的登录页就完美了,但下一个路径给出了404错误
<VirtualHost *:80>
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} =http
RewriteRule . https://%{HTTP:Host}%{REQUEST_URI} [L,R=permanent]
</VirtualHost>
我的laravel网页从
我的httpd.conf内容是,
我的访问权限是,
.htaccess位于/mobile文件夹下
请协助解决。
谢谢尝试以下重写规则:
RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context
。。。您需要确保将其放置在要应用它的站点根目录下的.htaccess文件中,并确保在httpd.conf中具有适当的AllowOverride配置
您是否已经将.inv文件也设置为https url?.inv文件?你说的是.env文件吗?是的,我已经更改了。我应该在哪里添加代码,我有Apachoump服务器的httpd.conf,然后我有laravel文件夹项目的.htaccess?更新的答案-放置在网站根目录的.htaccess文件中我添加了allowoverrite all-in-directory标记,并从https.conf中删除了上述virtualhost代码,并添加了您提供的代码。这会给我错误,您添加了太多重定向扫描您的httpd.conf和.htaccess的问题内容?您可以使用pastebin之类的工具转储整个内容。@neuromater我已经用pastebin dump更新了答案