CodeIgniter Forums
AliasMatch based on subdomain - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: AliasMatch based on subdomain (/showthread.php?tid=35760)



AliasMatch based on subdomain - El Forum - 11-10-2010

[eluser]mvdg27[/eluser]
Hi guys,

I'm working on a CMS project now. The CMS is located in 1 location on my server and by using Aliases I'm able to have the CMS working on multiple domains. For example like this:

Code:
Alias /cms /home/user/domains/domain/CMS/releases/stable/cms/

The folder /home/user/domains/domain/CMS/releases/stable/cms/ houses all the scripts, graphics, styles etc.

Now I have 3 different versions of the CMS: a stable release, a staging release and a beta release. And I would like to be able to switch between the versions using a subdomain. So for example:

staging.mydomain.com/cms would get me the staging release and beta.mydomain.com/cms would get me the beta release.

I've discovered that there exists a thing called AliasMatch, which should be able to do some sort of regular expressions based aliassing.

But so far I haven't been able to figure out how to do an AliasMatch based on the subdomains beta and staging (with a default alias to the stable version for all other cases).

Any experts here that might be able to help me out?

Thanks in advance!

Michiel