How to force user to use subdomain?

Posted by David Stockinger on Pro Webmasters See other posts from Pro Webmasters or by David Stockinger
Published on 2012-06-26T12:17:32Z Indexed on 2012/06/26 15:25 UTC
Read the original article Hit count: 283

Filed under:

I am hosting a webshop with OpenCart and its current URL is e.g. http://mydomain.com/shop/
I have created two subdomains ( http://pg.mydomain.com/ and http://shop.mydomain.com/ ) and both subdomains are already working as they should. However, can I restrict direct access to mydomain.com/shop/ while leaving all the files (index.php, etc.) there?
Since both subdomains are pointing to http://mydomain.com/shop/, I thought this would restrict all access.

So in the end, I would like my two shops to be accessable through http://pg.mydomain.com/ and http://shop.mydomain.com/, but not http://mydomain.com/shop/ while leaving all the files in http://mydomain.com/shop/.

© Pro Webmasters or respective owner

Related posts about subdomain