lundi 11 novembre 2019

Laravel routing based on domains

I am redeveloping a core-PHP web app to Laravel 5.8 application with (example) main domain: www.maindomain.com, and few route groups based on url prefix:

www.maindomain.com/user
www.maindomain.com/admin
www.maindomain.com/teacher

The app also has around 50 addon-domains, in the old app, all of them were pointing to one location (example: public_html/addondomains), and the content that was displayed was determined by the $_SERVER['http_host'].

I want to do the same in Laravel, but i can't set up the route rule for the addon domains. So, it needs to route any url that is not maindomain.com to a controller function. Any help? :)



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire