简体   繁体   中英

URL rewriting, url masking

I want to know if there is a solution to rewrite url from http://domain.com/username to http://username.domain.com ?

Also I want to mention, that this should be done automatically, when a new user registers.

I am using laravel 5 framework by the way.

Please check solutions below

Using .Htaccess

Read Solution at http://laravel.io/forum/03-11-2014-routing-for-subdomain

Using Laravel Controllers

Read at http://laravel-tricks.com/tricks/dynamic-subdomain-routing https://laracasts.com/discuss/channels/general-discussion/routing-for-optional-subdomain-domain-and-optional-tld?page=1

You will need to understand Laravel Basic Routing first. Read Laravel Documentation at

https://laravel.com/docs/5.1/routing

Hope this will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM