我在routes.php文件中定义的任何路线之上的简单路线发现:Laravel路线不以https
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>
请指引我。
Thanx。
我认为这将在5.2甚至工作。 http://stackoverflow.com/questions/28402726/laravel-5-redirect-to-https – aldrin27