Welcome Guest, Not a member yet? Register   Sign In
Assign Domain Name to Controller?
#1

[eluser]Jason Stanley[/eluser]
Using Apache.

Was wondering if this is possible. Users can sign up to my application and they have accounts which look like this.

domain.com/username/

I do this by using wildcard routing.

$route['(:any)'] = "frontend/$1";

I was wondering. If I wanted to assign a domain name to a client site. So domain.com/username would become domain2.com. Is that possible? Or does a domain name need to be assigned to a physical directory?
#2

[eluser]rogierb[/eluser]
It can probable be done using your apache config and .htaccess.
The second domain should probable have its own rootfolder where a index.php and .htaccess resides.
The .htaccess then should route to index.php/username.

You basically insert the 'username' part manually as the first segment.


Another way is to use the same root and adapt the index.php:
<code>$_SERVER['REQUEST_URI'] = '/username'.$_SERVER['REQUEST_URI'];</code>
but this will become unmanageable if you have a lot of domainnames/





Theme © iAndrew 2016 - Forum software by © MyBB