5

Is it possible to have multiple top-level-domains point to the same site? .com/.net/.eu etc...

I created a site in Laravel Forge and you have to tell him the domain your site is going to be on. This works for the .com domain, but how about the other tld's? Do I have to create multiple sites, Do I have to change it on the server itself (DNS) or are their any other methods?

AgeDeO
  • 3,137
  • 2
  • 25
  • 57
  • Check out this article: http://ryantablada.com/post/multi-tld-routing-in-laravel. Basically you can use [route groups](https://laravel.com/docs/master/routing#route-groups) to group routes for different domains like this: `Route::group(['domain' => '{user}.site.*'], function(){...}` – Adrenaxus Aug 12 '16 at 08:51
  • @Adrenaxus, thanks for the info, but my other tld's are not yet linked to the laravel installation because Forge cannot link the domain to the correct site. – AgeDeO Aug 12 '16 at 08:53
  • I understand. You'll need to point your other tlds to your main domain where laravel resides. I used cPanel's addon domains for this purpose, but there might very well be better options using Forge, I'll leave that to the Forge pros out there... – Adrenaxus Aug 12 '16 at 09:03

1 Answers1

12

I solved it myself:

  1. Create sites for your new tld domains
  2. Click the edit button 'pencil' next to your created site
  3. Click the edit file(s) button
  4. Click Edit NGINX configuration
  5. Change the following line: root /home/forge/****/public; to the path of the main domain.
AgeDeO
  • 3,137
  • 2
  • 25
  • 57
  • The nginx config file appears to be changed to the new domain automatically now by the Forge system. – tim peterson Jul 26 '18 at 19:31
  • If you want to set up SSL certificates with Let's Encrypt, you have to generate them on the 'main' site, using all of the domains added as described in this answer. – Amade Sep 27 '18 at 20:40
  • just updated root from forge for new site and SSL set at Cloudflare ... that's all (since i used Cloudflare thats why mentioned whatever you are using) – Furqan Freed May 03 '23 at 12:04