简体   繁体   中英

Is it possible to create virtual subdomains?

I have a wordpress based site, that has data divided in it on the basis of country and state.

So the url goes like this
http://xyz.com/US/category_id
http://xyz.com/UK/category_id

there are no seperate folders for UK or US. I was wondering if it possible to create multiple sub-domains like this

http://US.xyz.com
http://UK.xyz.com

without having different folders to route the sub-domains?

Yes, but how you implement this depends on the type of service you use. Most light users purchase a shared hosting service. Your suppliers FAQs should give you advice. Some provide a control panel to map individual subdomains to separate subdirectories under your document root. Others simply map *.youdomain.com to your document root. In this latter case you need to use a .htaccess file and decode the HTTP_HOST to map each subdomain to a separate directory yourself.

If you do search here for [.htaccess] HTTP_HOST votes:2 then you will finds lots of examples of how to do this. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM