Forum Moderators: phranque

Message Too Old, No Replies

htaccess alternative to this soft link solution?

Is there a way to do this?

         

explorador

10:36 pm on Jul 31, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi webmasters, I'm trying to make 4 websites to use the same cgi-bin dir, all of them under Cpanel. I solved this using symbolic links on the server but this is kinda tricky when I do backups.

The reason for this is: one website (domain) holds the cgi-bin folder with a main app while the other 4 websites (domains and-or subdomains) call the same folder so I end up with only ONE cgi-bin folder AND only one source code to mantain. The app is already working differencing the data and querys from diff sites. I just got tired of upgrading and updating every single website (and is going to grow some more with more websites).

My concerns are:
  • This is working already but zip backups do not work, only tarballs. Restoring might be tricky sometimes.
  • Having a solution via htaccess would be great as it would be a single file, right?
  • Having a htaccess solution would mean problems if I move to another server NOT running apache?


Thanks in advance, I researched but my htaccess is limited, made tests but it doesn't appear to work outside its own top level once a domain is involved.

jdMorgan

3:05 am on Aug 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache mod_alias, specifically the Alias and ScriptAlias directives.

These directives work in server config files, not in .htaccess which is a per-directory config file.

If you can't modify the server config, and symlinks don't work well for you, then perhaps you should look at hosting more suitable to supporting multiple sites.

Jim

explorador

4:12 am on Aug 2, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks Jim for the help, I will look directly on that.