Current URL : http://www.domain.com/billing/signup.php?a=1&b=2
What I need : http://billing.domain.com/register.php
I’m not really good at htaccess syntax so I would like to ask for some help here. I don’t need the query string anymore as the old url is already expired and I only need a 301 redirect to the new URL with the query string removed.
Any help would be highly appreciate.
In the htaccess file in your document root for the
www.domain.comdomain, you can do one of 2 things.Using mod_rewrite:
Or using mod_alias:
This completely ignores what the query string actually is. It just matches against the URI,
/signup.phpand redirects to the target. Note that the?at the end makes sure the existing query string doesn’t get appended.