0

I have a site, widgets.com.

Upon initial visit to widgets.com, the user should land on the landing page (codebase is at /home/web/landing). On this page will be our beautiful graphics, and a link to log in. The user will click the login button (*something else should probably happen here as well. Maybe php sets a variable/cookie to tell apache that the user has clicked the login button so that the DocumentRoot can change), and then they will be directed to our main system (codebase is at /home/web/main-application) for authenticating.

Long story short, when the user clicks on the login button, the main system will take over, so I would need the documentroot to change at runtime. Is this possible, and how would I go about this?

I have looked at mod_define, and mod_macro, but I get the feeling that these are for creating dynamic configuration files that will not change at runtime.

  • Ummm why? Just put your landing page in the DocRoot and use a RewriteRule to sort out the routing accordingly... – CD001 Apr 16 '15 at 14:25
  • besides, different content on the same page will be bad for your SEO – mariobgr Apr 16 '15 at 14:26
  • Is there a strong reason you need this functionality? It would be simpler and less convoluted to use the same DocumentRoot, or at least two virtual hosts (maybe `auth.widgets.com` can point to `/home/web/main-application`)? – Chris Brendel Apr 16 '15 at 14:26
  • Thanks for all of the responses. This is my first time attempting something like this, so I am completely open to suggestions if I'm going about it in a non-optimal way. – Christopher D Apr 16 '15 at 14:29
  • @mariobgr, so it would be a better idea to have maybe widgets.com for the landing page, and then maybe widgets.com/home for the main system? – Christopher D Apr 16 '15 at 14:31
  • Well, yes, that's the general practice and it has proved to be working fine :) – mariobgr Apr 16 '15 at 14:34
  • @ChrisBrendel So if I went the 2 virtual hosts route, would I have 2 ServerName directives? One in each vhost configuration with the landing page as such: `ServerName widgets.com/landing`, and the main as such: `ServerName widgets.com/home` – Christopher D Apr 16 '15 at 15:04
  • @ChristopherD If you'd like to use subdirectories instead, you can create aliases that point to the corresponding folders. Check out this post: http://stackoverflow.com/questions/12879298/create-an-alias-directory-inside-a-virtual-host – Chris Brendel Apr 16 '15 at 17:21

0 Answers0