jeudi 25 octobre 2018

Set up Laravel project to work with multiple Domain Name

enter image description here

I have successfully configured multiple domains to point to my Laravel 5.1 project

<Virtualhost *:80>
  VirtualDocumentRoot "/Users/Sites/project/public"
  ServerName app.com
  UseCanonicalName Off
</Virtualhost>

<Virtualhost *:80>
  VirtualDocumentRoot "/Users/Sites/project/public"
  ServerName app2.com
  UseCanonicalName Off
</Virtualhost>

<Virtualhost *:80>
  VirtualDocumentRoot "/Users/Sites/project/public"
  ServerName app3.com
  UseCanonicalName Off
</Virtualhost>

When I go to

app.com app2.com app3.com

any of them will point to my project and load the log-in screen.


Issue

When I login, regardless when I am from, I kept redirecting my users to

app.com/dashboard


Goal

My goal is, any request from

app.com  --> log-in --> redirect to --> app.com/dashobard
app2.com --> log-in --> redirect to --> app2.com/dashobard
app3.com --> log-in --> redirect to --> app3.com/dashobard


Questions

How would one go about and do this on a Laravel project ?

Is this something that I can do on the application layer or web server ?


I'm open to any suggestions at this moment.

Any hints/suggestions / helps on this be will be much appreciated!



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire