I have three folders in my document root –
localhost/myMainProject/
localhost/myMainProjectSubdomain/
localhost/myThirdProject/
I want to do the achieve following URL mapping –
www.mymainproject.com ---> localhost/myMainProject/
mysubdomain.mymainproject.com ---> localhost/myMainProjectSubdomain/
www.mythirdproject.com ---> localhost/myThirdProject/
I tried to change my hosts file to :
127.0.0.1/myMainProjectSubdomain mysubdomain.mymainproject.com
127.0.0.1/myMainProject www.mymainproject.com
127.0.0.1/myThirdProject www.mythirdproject.com
But this doesnt work. I think I have to create some .htaccess file or something somewhere but have no idea how that works.
Is this possible ? Please guide me on how this can be achieved. Thanks.
Put this in your htaccess file in the document root: