문제

I am lost... as always the htaccess file is like vodoo... i am trying to redirect all traffic from a domain regardless of its URI to a specific page on another domain. This is what I have and it is failing with a 500 error:

RewriteCond %{HTTP_HOST} (^|\.) domain\.com$
RewriteRule ^ https://www.example.com/some/other/page/ [L,R=301]

Can someone tell me what I am doing wrong? Like I said I am trying to ignore the URI requested and force a redirect to a specicif page on another domain.

도움이 되었습니까?

해결책

If you want to redirect everything from domain.com (and also every subdomains), try this way

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(.+\.)?domain\.com$ [NC]
RewriteRule ^.*$ https://www.example.com/some/other/page/ [R=301,L]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top