【发布时间】:2016-08-14 02:17:20
【问题描述】:
我在 routes.php 中定义了一个简单的路由,位于任何路由之上:
Route::get('/test', function () {
echo 'hello';
});
通过http访问时它正在工作,但它给出了:
The requested URL /test was not found on this server.
当我尝试通过 https 访问时。
我在互联网上搜索了很多,但找不到任何解决方案。
我的主页正在加载 http 和 https,但其他路由不起作用。我需要一些额外的配置吗?
编辑:
.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
请指导我。
谢谢。
【问题讨论】:
-
我认为即使在 5.2 中也可以使用。 stackoverflow.com/questions/28402726/…
标签: php http https laravel-5.2