简体   繁体   中英

URL on a landing page and URL after logged in

Why are a landing page and a page after user logs in same on most websites? For example, on Facebook the landing page url is https://www.facebook.com . After you logs into FB you are redirected to Home but same url as above: https://www.facebook.com .

Does it mean Facebook uses the same file (eg index.html/index.php) for the landing page and the the page after user logs in?

Thanks!

The webserver can serve different content based on many factors; cookies in this case. The URL you see in the bar doesn't have to correlate the same path on some server - the application can dynamically accept or reject any path (it's just a string). In PHP, you can do this with a front controller which is pattern used by many frameworks like Symphony and Laravel.

As for why Facebook does this, they probably just think it looks better that way.

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