开发者

Redirect homepage but not if there are query strings present

I want to开发者_Go百科 redirect just the homepage of a Wordpress site but only if the original URL does not have any query strings on it. This works:

RedirectMatch 307 ^/$ http://www.consumerenergyreport.com/ticker

...but redirects URLs with queries. I tried:

RewriteCond ! %{QUERY_STRING}

...but that doesn't seem to work with RedirectMatch, only RewriteRule (go fig).

Any ideas? Thanks in advance!


Try this rule in .htaccess file:

Options +FollowSymlinks -MultiViews
RewriteEngine on

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^/?$ /ticker [R=307,L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜