Context: I am designing a web application that’s geared toward members-only features. There’s no site features that would be useful to non-members, so most of the website will only be available to authenticated users. Thus, the only public pages will be things like an About Us page (with contact options), a Features/Comparisons page (promote the service relative to competitors), and of course a Home Page.
Problem: My initial thought was that the homepage
index.php file, located at the website root, should load the public content for non-authenticated visitors, but should load the main application landing page for authenticated users. My main reason was for members’ ease-of-access — automatic serving of the content they’re actually trying to get to, and no need to type / remember / bookmark a more complicated address than
mysite.com. But this got me thinking whether that would be best practice. I couldn’t find anything with a few Google searches, so….
Approaches: I can think of three:
- As mentioned above: All files are hosted under
mysite.com, with no subdomains. When a visitor requests
mysite.com/index.php, it checks for authentication, and serves up the correct HTML depending.
- Public files are hosted under
www.mysite.com, while member-only pages are hosted under a subdomain like
members.mysite.com. When an authenticated user attempts to access the public
www.mysite.com/index.php, they’ll be automatically redirected to
- The same as option 2, but instead of being automatically redirected, the user will stay on the public homepage, and will need to navigate to their application landing page via the main nav. (This approach seems best if some of the public pages actually have usefulness to authenticated users, which they won’t on my site, so I’m thinking this option doesn’t make sense?)
- Are there other options I’m not thinking of?
- Is there a clearly established best practice for this situation?
- How does each approach affect SEO, if at all?
- Which of those approaches tends to be easiest to code for and maintain in the long run?