Htaccess Redirect Domain With Query String
The final part of the redirect for your url with a query string is the actual rewrite rule.
Htaccess redirect domain with query string. This is so elementary that you have to ask why it is so complex to implement. This is the section that changes the url as long as the rewrite conditions are met. In order to redirect your old domain to a new domain name you should add the following rewrite rule to your htaccess file.
Using redirect in an htaccess file enables you to redirect users from an old page to a new page without having to keep the old page. Doing so requires slightly different directives that many people are not aware of so it s common to see a questions like why isn t my redirect working for query strings. One of the most common question when talking about apache and mass redirections is how to configure a query string based redirect for a specific page.
The rewriterule will take all requests and point to your new domain and keep whatever directories file name and query string is in your old links. The only trick is redirecting based on the url s query string value. Redirect to a local site file.
How to redirect an old domain to a new domain. In general redirecting urls is a piece of cake with apache s htaccess. R 302 is the http code temporary moved or you can do r 301 which is permanent moved redirect nc means case insensitive.