Configuring Nginx(or Forge) to handle multiple domains on one root but not wildcard
Hi again,
Is there anyway setting up multiple domains pointing to one single Laravel app.
For example, I would like one.example.com and two.example.com pointing to one app, and maybe I want the main domain pointing to another app on the same server. I do know there is the "wildcard" option available, but I think that is not I want as all sub-domains will be routed into only one app.
Or, is there a way to setting root domain with two domains separated by the comma?
For instance,
Root domain: one.example.com, two.example.com, four.example.com
Please suggest what I could do with this case.
Thank you.
Route::group(array('domain' => 'one.example.com'), function()
{
// routes for two.example.com go here
});
Route::group(array('domain' => 'two.example.com'), function()
{
// routes for two.example.com go here
});
@bashy, I know this is a bit old, but can you explain what you mean by "Then add another vhost for another site and enter that new site name in." a bit more?
@bashy, I am trying to add in another site similar to the OP example. In other words, I would like NewName.com to be a identical to OldName.com (OldName.com needs to still exist).
Here is what I have done.
created a new site on forge and changed the server name as you suggested above:
server_name oldName.com newName.com;
I have set up a new domain in digital ocean with an cname of newName.com
With this setup, the newName.com is redirecting to my default digital ocean site unrelatedSite.com
There must be something I am missing in the process, which is how I came across your answer from a year ago.