开发者

Apache: Redirect domain to other domain with appended querystring

I want example.se to redirect to example.com?lang=swe

It works fine with this apache config:

<VirtualHost *:80>
    ServerName example.se
    ServerAl开发者_如何学运维ias *.example.se
    Redirect permanent / http://example.com/?lang=swe
</VirtualHost>

The problem is that this breaks if there is something else after the domain, ex: example.se/page1 should redirect to example.com/page1?lang=1 but with the setup above it redirects to example.com?lang=swepage1.

Is there a way to do this right?


I believe it should be something close to this:

RedirectMatch permanent ^/(.+)$ http://example.com/$1?lang=swe

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜