문제

We have two domains, www.aaa.com and www.bbb.com. Both point to the same root directory on the server.

The server has two sub-directories in the root: /abc/ and /xyz/.

If someone types in www.aaa.com/abc/ They should go to /abc/ (like normal)
If someone types in www.aaa.com/xyz/ They should go to /xyz/ (like normal)
** If someone types in www.bbb.com/abc/ They should go to /xyz/ (using the rewrite)
If someone types in www.bbb.com/xyz/ They should go to /xyz/ (like normal)

How do we write that rewrite for the third case above, where it only affects domain www.bbb.com and not www.aaa.com?

도움이 되었습니까?

해결책

You need to use condition and a rule:

RewriteCond %{HTTP:Host} ^www\.bbb\.com$ [NC]
RewriteRule ^abc$ /xyz [NC,L]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top