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 if they're already logged in, and no need to type / remember / bookmark a more complicated address than example.com
. But this got me thinking whether that would work best in the long run for issues like SEO and maintainability.
Approaches: I can think of three:
- All files are hosted under
example.com
, with no subdomains. When a visitor requestsexample.com/index.php
, it checks for authentication, and serves up the correct HTML depending. (This is the approach I mentioned above.) - Public files are hosted under
www.example.com
, while member-only pages are hosted under a subdomain likemembers.example.com
. When an authenticated user attempts to access the publicwww.example.com/index.php
, they'll be automatically redirected tomembers.example.com/index.php
. - 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?)
Which of these approaches would be best in terms of SEO, being easy to code, and easy to maintain?