The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Redirect with .htaccess, hiding the real URL
thepixel
post 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... 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!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 02:12 AM