Redirect with htaccess by holding the URL

5

I need to redirect a registered domain (domain.com.br) to a folder of the domain of my hosting (domain.com/exclusive), but I want to maintain the domain.com in the address bar, without losing the integrity of the URL, that is, all pages also stay in the address bar ex: domain.com.br/contact, / service, / institutional ....

Is it possible to make this rule in htacess? Can anyone help me?

    
asked by anonymous 16.09.2015 / 18:09

2 answers

3

Type your .htaccess so

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^$ exclusive/index.php [L]
    RewriteRule ^(.*)$ exclusive/$1 [QSA,L]
</IfModule>

If you want to implement friendly URLs:

Implementing Friendly URLs with Routing

    
17.11.2015 / 04:44
-3

It is possible to do it by .htaccess, but I recommend an easier and more efficient way using the JavaScript property (window.location.href), allowing you to customize it by putting time and etc ... to your liking. / p>

Example property window.location.href
window.location.href = 'http://www.google.com.br/'; // Redireciona você para o site da Google

    
16.09.2015 / 21:27