Create and Use Dynamic Laravel Subdomain Routing

Full Article :

LikeGeeks - https://likegeeks.com/dynamic-laravel-subdomain-routing/

Many websites give their users a custom subdomain for their profiles or pages, so instead of accessing the user’s profile at

http://website.com/users/50, the user can access his profile page athttp://username.website.com  which is much better. In this post, we will see how to make dynamic Laravel subdomain routing easily.Configure DNS

To make this trick, you need to have access to the DNS server settings and apache web server settings.

First, you need to add an A record with an asterisk for the subdomain like this:

*              IN          A             192.168.1.5

You should replace the IP address with your IP address.

Configure Web server

Open apache web server configuration file httpd.conf and

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: