Domain Multiplus with Codeigniter

Asked

Viewed 84 times

-1

I have a hosting with two domains, domain 1.com.br and domain 2.com.br.

How Codeigniter is at the root of hosting, how do I, when i access the domain 1.com.br it take the content of the folder site1 and display, and do the same thing in domain 2.com.br and display the content of the site2 folder in which it mixes?

I don’t know if it’s possible to do this in . htaccess

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

1 answer

-1

You can do this using .htaccess. Then you need to treat 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.