Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Web Server Configuration _ Redirect with .htaccess, hiding the real URL

Posted by: thepixel Sep 21 2014, 06:37 PM

Hello!

I'm stuck on a .htaccess problem and I deeply need your help! I hope I'll be able to explain my problem clearly, but I'm french, so it doesn't help... rolleyes.gif

I have a domain, www.mydomain2.com, that I'd like being redirected to www.mydomain1.com/folder_site2/ but I'd like the URL that appears in the address bar being "www.mydomaine2.com" instead of the "www.mydomain1.com/folder_site2/"

After searches on Google, I made my .htaccess looking like this:

CODE
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain2\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/folder_site2
RewriteRule ^(.*)$ /folder_site2/$1 [L]


I first thought it was working fine, as, when I typed "mydomain2.com", I was correctly redirected on "www.mydomain1.com/folder_site2/" with "mydomain2.com" as visible URL.
But it seems it's impossible to reach a sub-folder. Any URL like "mydomain2.com/subfolder/text.html" would reach to a 404 (while it was possible to reach via "mydomain1.com/folder_site2/subfolder/text.html")

What have I done wrong? huh.gif

Thanks a lot for any help you could bring!

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)