Redirect URL with query string on same domain but different directory using htaccess

I am trying to redirect a page to another page along with query string.
Example:

The URL below

http://example.com/firstdir/?abc=xyz

needs to redirect to the below URL with same query string on same domain.

http://example.com/seconddir/?abc=xyz

When there are no query string added in the URL, it should stay on the same page and will not redirect.

I have tried to explain what I am looking for, please HELP !!!

tHANK YOU.


Source: .htaccess

Leave a Reply