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]
精彩评论