How do I change the domain when using URL::action()

二次信任 提交于 2019-12-05 19:00:49

Laravel 4 uses the Domain specified in the HTTP Request Header Field Host, e.g. Host: http://foo.dev.

If you want a different domain name, try something like this:

Route::group(array('domain' => 'bar.dev'), function()
{
    Route::controller('home', 'HomeController');
});

Now URL::action('HomeController@getWelcome');returns https://bar.dev/home/welcome instead of https://foo.dev/home/welcome

The location of the "app"-directory is defined in: \bootstrap\paths.php The default location of config file is now: \app\config\app.php

Depending on your setup, it should be around line 29 in app.php.

Look for:

'url' => 'http://somedomain.com',

And change this to whatever suits your website.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!