ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Forward domain to subdomain

May 26, 2008 6:19am

Subscribe [1]
  • #1 / May 26, 2008 6:19am

    MikeNZ

    1 posts

    Hi there,

    I’ve been reading up on the CodeIgniter wiki for the past few weeks now and am really excited to start my first CI project. However I’m having trouble planning one element of my project and I’m not 100% sure it’s possible so I’ll do my best to explain it and hopefully the CodeIgniter community can help me out 😊.

    Basically I have a subdomain lets say - abc.example.com and a seperate domain - test.com. I need to point test.com to the abc.example.com directory. So for example if I went to test.com/about/ it would load abc.example.com/about/ but the url in the users browser would still be test.com/about/.

    I realise this is a really bad explanation but hopefully you get the idea.


    Thanks

    Mike

  • #2 / May 26, 2008 12:18pm

    Sean Murphy

    97 posts

    You just point the two domains to the same server and use name based virtual hosts (if you’re using apache).

    Here’s something to get you started:

    NameVirtualHost *:80
    
    <VirtualHost *:80>
        ServerName abc.example.com
        DocumentRoot /path/to/codeigniter
    </VirtualHost>
    
    <VirtualHost *:80>
        ServerName test.com
        DocumentRoot /path/to/codeigniter
    </VirtualHost>

    You can do more reading on apache vhosts here: http://httpd.apache.org/docs/2.0/vhosts/name-based.html

  • #3 / May 27, 2008 3:47am

    MikeNZ

    1 posts

    That’s a big help. Thanks Sean!

    Mike

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases