I'm trying to do a simple invisible redirection with .htaccess
which almost work. I'd like my main domain name example.com
to access the content of the folder example.com/V8/
but keeping only the domain name in the URL.
A weird thing happens when I use the following code:
DirectoryIndex index.php
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /V8/$1 [NC,L]
This code does redirect to the right folder without changing the URL, but as soon as the page is loaded, another redirection happens to a white page with my email address as a link. When I look at the source code it says:
<a href='mailto:[email protected]'>[email protected]</a>
Then if I directly go to example.com/V8/
, I can access the page without being redirected to this email page.
If I update the last line of the .htaccess
to:
RewriteRule ^(.*)$ /V8/$1 [R=301,NC,L]
There's no double redirection, but the redirection I want is not invisible anymore because of the R=301
.
Can someone help me find out what the problem is?