0

I'm driving crazy about this, but I'm sure it's only a small thing..

All I'm trying to do is redirecting https server traffic to another website in my virtual hosts config file:

<VirtualHost 127.0.0.1:443>
  ServerName somewebsite.ch
  RewriteEngine on
  RedirectMatch 301 ^client$ https://someotherwebsite.com/client
  RedirectMatch 301 ^/client$ https://someotherwebsite.com/client
</VirtualHost>

However, this doesn't seem to work, it looks like the page tries to load the content of the other website, but the Adress Field in the browser still shows the old URL, and the browser body is empty..

Thanks for your help.

4

1 回答 1

1

您是否尝试过在末尾添加斜杠?您的配置不匹配,例如 /client/

 RedirectMatch 301 ^/client/$ https://someotherwebsite.com/client

如果 URL 在client之后继续,您可以这样做:

 RedirectMatch 301 ^/client(.*)$ https://someotherwebsite.com/client$1
于 2012-04-15T18:16:53.853 回答