cnl2860 Posted March 4, 2012 Share Posted March 4, 2012 Hello you freaks I'm all new in this forum. Right now i'm working on a webshop project in codeigniter. In the end there will be multiple webshops on subdomains, and a frontpage on the main domain. It's surposed to be all dynamic so that the webshops get there own subdomains. The shop information is in the database. Lets say i got a mysql table which contains info like this: webshop: Bobs shop webshop_subdomain: bobsshop And so on. And now in a .htaccess file i want to make a rewrite rule so that bobsshop.mydomain.com will be rewritten to mydomain.com/bobsshop/ since i'm working in codeigniter with controllers. You should bear in mind that the index.php also have to be rewrited out. And there should also be the possibility to make subpages like bobsshop.mydomain.com/contact/ I will make a php script which will check if the subdomain exists in the database and if it doesn't exists in the database the visitor will se a 404. My DNS setup looks like this ATM: mydomain.com xxx.xxx.xxx.xxx *.mydomain.com xxx.xxx.xxx.xxx Where xxx.xxx.xxx.xxx is my server IP. I've really never worked with htaccess / mod_rewrite before. Can it be done? And are there anyone who can help me make this? And sorry for my english. I'm from denmark. Hope you understand what i'm trying to do. Best Regards Christian Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/258268-help-with-mod_rewrite-and-htaccess-in-codeigniter/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.