我正在尝试使用我的laravel项目运行3个域名maindomain可以将其称为mydomain.com de.mydomain.com en.mydomain.com
我的route.php是:
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时,网址会更改为de.mydomain.com/de 请注意/ de添加结尾我收到错误500内部服务器错误
我是否错误地描述了这条路线?
修改 如果我去de.mydomain.com/test它不会加载TestController @ index。如果我不添加参数(测试或其他东西)所以只需de.mydomain.com我的网址说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>