Ask Your Question

Revision history [back]

To redirect a subdomain without passing on the query strings in the URLs, you can use a 301 redirect in your server's .htaccess file. The code should be added to the top of the file and would look something like this:

RewriteCond %{QUERY_STRING} !="" RewriteRule ^ http://newsubdomain.example.com/? [L,R=301]

This code will redirect all requests from the old subdomain to the new subdomain without passing on any query strings. The [L,R=301] flags at the end of the line indicate that this is a permanent, 301 redirect.

It's important to note that this method will only work if the subdomains have the same URL structure. If the URLs are significantly different, the redirection may not work as intended.