0

Recently found out that there are other domain names pointing to my Laravel website.

Suppose I have a Laravel website abc.com. If someone browse for xyz.com and it redirects to my site abc.com. But I want to prevent this.

Is there any way to do this in Laravel.

Arafat Rahman
  • 993
  • 5
  • 19
  • 46
  • 1
    See [this other question](https://stackoverflow.com/questions/42542061/how-to-get-all-the-headers-information-in-laravel-5-4) and check for the `Referer` header. Or the `Host` header if they just pointed their domain to your machine. – Federico klez Culloca Nov 28 '19 at 09:20
  • @FedericoklezCulloca.....I want to prevent this redirection. – Arafat Rahman Nov 28 '19 at 09:37
  • You can't. It's their domain, it's out of your control. You can only decide what to do once the redirect has happened. – Federico klez Culloca Nov 28 '19 at 09:38
  • @FedericoklezCulloca...okay. so is there any way that If any domain redirect I can redirect those domain to a specific page ? – Arafat Rahman Nov 28 '19 at 09:43
  • Once you determined that the request is coming from somewhere else you can [set the Location header](https://stackoverflow.com/questions/15643718/location-headers-in-laravel) to cause a redirect. – Federico klez Culloca Nov 28 '19 at 09:47

0 Answers0