.httacces and virtual subdomains - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: .httacces and virtual subdomains (/showthread.php?tid=21415) |
.httacces and virtual subdomains - El Forum - 08-09-2009 [eluser]jurosik[/eluser] hi folks, i need to use virtual subdomains and use it as a variable, like: http://var.domain.tld would use /default controller http://var.domain.tld/foo would use /foo controller and so on.. i'm totaly lost in these .htaccess expressions please, is here anyone who could help? thx .httacces and virtual subdomains - El Forum - 08-10-2009 [eluser]jurosik[/eluser] nobody? it's the same thing as on EveryBlock website: http://sf.everyblock.com/ i was trying almost everything, but all i get was that 500 Internal Server Error .httacces and virtual subdomains - El Forum - 08-10-2009 [eluser]brianw1975[/eluser] I'm not really sure what you mean.... the example just shows the same subdomain Quote:http://var.domain.tld would use /default controller and the / and /foo are of typical codeigniter usage... do you really mean you want to do something like: Code: http://(www.)domain.tld/ uses the default controller are any of those what you want? .httacces and virtual subdomains - El Forum - 08-10-2009 [eluser]t'mo[/eluser] As a cheap hack to serve three domains (call them 'domain.com', 'domain1.com', 'domain2.com') from the same hosting account, I've recently added something like this to my root .htaccess file: Code: RewriteEngine on All three domains resolve to the same IP address. Requests for the first domain go to index.html (or whatever I've set the default page in / to be). Then these entries in .htaccess are routing requests to the other domains according to the values of the HOST header. The requests for domain1.com are handled by domain1_index.php, likewise for domain2.com. I'm not sure if it will work for sub-domains, but I'll be trying that soon, since I want 'test.domain1.com' and 'www.domain1.com' to be different. .httacces and virtual subdomains - El Forum - 08-11-2009 [eluser]jurosik[/eluser] ok guys, let me better explain my problem. i have site with structure like this: Code: domain.tld/uk/post/1 uk is country code for united kindom, and i want this code move to the subdomain. virtual subdomain, there is no real subdomain at all. Code: uk.domain.tld/post/1 this is my .htaccess for now, which gives me 500 Internal Server Error on uk.vzahranici.sk: Code: <IfModule mod_rewrite.c> .httacces and virtual subdomains - El Forum - 08-11-2009 [eluser]renownedmedia[/eluser] I'm thinking this will require more than changing a .htaccess file... You might need to change DNS settings on the fly, with predefined subdomains being written to a config file, and this may be impossible on shared hosting. |