I'm using CodeIgniter to build my first web app. For demo purposes, users can preview their site by simply using their Facebook username as a paramater (using public data from the Graph API). So they access their data using:
myurl.com/controller/function/**username**
However in the future I'd like users to be able to use their custom domain to view a similar page.
I've read around the topic but their doesn't seem to be an agreed solution. Some say I need to use mod_rewrite
in .htaccess
, some suggest using virtual hosts
, some mention playing with $_SERVER
requests to redirect users. There seem to be plenty of suggestions but not so many examples to help decide.
I'm quite happy to set up each domain manually (i.e. by editing .htaccess by hand), but I still would like to be able to use a single CodeIgniter installation.
So, how can I point multiple URLs/custom domains to a CodeIgniter URL, and what security implications are there?
Possible related link