CodeIgniter Forums
Create dynamic subdomain url - 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: Create dynamic subdomain url (/showthread.php?tid=18796)



Create dynamic subdomain url - El Forum - 05-18-2009

[eluser]The Spider[/eluser]
Hi,
I have an idea to create dynamic Urls when developing in my local machine and in the test server.
The url used local is http://localhost/myproject/ and the same in live is http://192.152.11.10/myproject
My idea is to set local to dev.myproject.com/ and the test server to test.myproject.com.
Can any one help me?

Thanks


Create dynamic subdomain url - El Forum - 05-19-2009

[eluser]TheFuzzy0ne[/eluser]
If you're running a Windows machine, you can open up c:\Windows\System32\drivers\etc\hosts in your favorite text editor, and add this line:

Code:
127.0.0.1       dev.myproject.com

That will get the domain name resolving your localhost, the rest is up to you.

Obviously, this domain won't work from the outside, unless you purchase myproject.com and set up the necessary DNS.