Redirect with .htaccess, hiding the real URL |
Redirect with .htaccess, hiding the real URL |
thepixel |
Sep 21 2014, 06:37 PM
Post
#1
|
Group: Members Posts: 1 Joined: 21-September 14 Member No.: 21,579 |
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... 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? Thanks a lot for any help you could bring! |
Lo-Fi Version | Time is now: 26th April 2024 - 02:13 PM |