Multiplus domain with Codeigniter

-1

I have a hosting with two domains, domain1.com and domain2.com.

As Codeigniter is at the root of hosting, how do I, when I access the domain1.com it takes the contents of the site1 folder and displays, and do the same thing in domain2.com and display the content of the site2 folder in which it is mixed?

I do not know if this is possible in .htaccess

I would like to take advantage of the same hosting for 2 different websites with different domains without having to buy a hosting for each site.

    
asked by anonymous 19.10.2016 / 16:29

1 answer

-1

You can do this using .htaccess. Then you need to handle this in Code Igniter.

Options +FollowSymLinks


RewriteEngine on

#
# Redirecionando o domínio para a pasta correta
#
# Regra para cada domínio, copie e adapte para cada domínio
RewriteCond %{HTTP_HOST} ^(www.)?dominio1.com$
RewriteCond %{REQUEST_URI} !^/pastadominio1/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /pastadominio1/$1

#
# Removendo /pastadominio1/index.php da URL
#
# Regra para cada domínio, copie e adapte para cada domínio
RewriteCond %{HTTP_HOST} ^(www.)?dominio1.com$
RewriteRule ^(/)?$ pastadominio1/index.php
    
19.10.2016 / 17:38