子域路由laravel
我正在尝试用我的laravel项目运行3个域一个主域让我们称之为mydomain.com de.mydomain.com en.mydomain.com My route.php是:子域路由laravel,laravel,routing,Laravel,Routing,我正在尝试用我的laravel项目运行3个域一个主域让我们称之为mydomain.com de.mydomain.com en.mydomain.com My route.php是: Route::group(array('domain' => 'mydomain.com'), function() { Route::get('/', 'HomeController@index'); Route::get('test', 'TestController@index');
Route::group(array('domain' => 'mydomain.com'), function()
{
Route::get('/', 'HomeController@index');
Route::get('test', 'TestController@index');
Route::get('collecties', 'CollectiesController@index');
Route::get('contact', 'ContactController@index');
Route::post('contact', 'ContactController@postIndex');
});
Route::group(array('domain' => 'de.mydomain.com'), function()
{
Route::get('/', 'HomeController@index');
Route::get('test', 'TestController@index');
Route::get('collecties', 'CollectiesController@index');
Route::get('contact', 'ContactController@index');
Route::post('contact', 'ContactController@postIndex');
});
mydomain.com上的一切都很好,但问题是:当我转到de.mydomain.com时,url会更改为de.mydomain.com/de注意/de add the end,我收到一个错误500内部服务器错误
我把路线配置错了吗
编辑
如果我去de.mydomain.com/test,它不会加载TestController@index. 如果我没有添加参数(测试或其他),那么只需de.mydomain.com,我的url就会显示de.mydomain.com/de
我的.htaccess:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
<FilesMatch "\.php$">
AddHandler x-httpd-php54 .php
</FilesMatch>
选项-多视图
重新启动发动机
#重定向尾部斜杠。。。
重写规则^(.*)/$/$1[L,R=301]
#处理前控制器。。。
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^index.php[L]
AddHandler x-httpd-php54.php
我想我会在这个问题上添加apache标签,因为我认为问题不在于laravel routes。我觉得你的apache配置导致了这个问题,但我承认我对apache不是很在行。Oke谢谢你,我会用那种方式搜索,但是你能确认我的routes.php是Oke吗?我不能100%确认,因为我目前没有访问我的测试环境的权限,我不确定你是否需要像示例所示的那样传入帐户,你试过了吗?我试过了,但不起作用。