Redirect a URL with a query string to a specific subdomain with the same query string
Here's the goal: redirect this: http://exa开发者_运维问答mple.com/someDir/default.aspx?Some=query to: http://sub.example.com/home/default.aspx?Some=query
Is this at all possible in .htaccess? Can I do it in a WordPress environment?
Thanks for your help!
-Jacob
Yes -- RedirectMatch lets you use capture groups:
RedirectMatch 301 /foo/bar.aspx(\?.+)? http://sub.example.com/foo/bar.aspx$1
精彩评论