如何使用HTACCESS的查询字符串重定向页面?

How would I go about redirecting the below URL with query string. The new URLS will include "page = page name" as the first parameter as a result. The values of all of the other parameters will vary.

1)

OLD

https://example.com/index.php?LOANAMOUNT=350%2C000.00&DOWNPAYMENT=20.000+&DOWNPAYMENT_TYPE=Percent&TERM=30&TERM_UNITS=Years&INTERESTRATE=5.700+&COMPUTE=COMPUTE&CALCULATORID=HF02&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

NEW

https://example.com/index.php?page=monthly-payment&LOANAMOUNT=350%2C000.00&DOWNPAYMENT=20.000+&DOWNPAYMENT_TYPE=Percent&TERM=30&TERM_UNITS=Years&INTERESTRATE=5.700+&COMPUTE=COMPUTE&CALCULATORID=HF02&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

2)

OLD

https://example.com/index.php?MAXPAYMENTAMOUNT=2%2C100.00&INSURANCE=80.00&PROPERTYTAX=1.250+&PROPERTYTAX_TYPE=Percent&ASSOCIATIONDUES=0.00&DOWNPAYMENT=10.000+&DOWNPAYMENT_TYPE=Percent&TERM=30&TERM_UNITS=Years&INTERESTRATE=5.700+&INCOMETAXRATE=25.000+&COMPUTE=COMPUTE&CALCULATORID=HF09&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

NEW

https://example.com/index.php?page=how-much-can-i-afford&MAXPAYMENTAMOUNT=2%2C100.00&INSURANCE=80.00&PROPERTYTAX=1.250+&PROPERTYTAX_TYPE=Percent&ASSOCIATIONDUES=0.00&DOWNPAYMENT=10.000+&DOWNPAYMENT_TYPE=Percent&TERM=30&TERM_UNITS=Years&INTERESTRATE=5.700+&INCOMETAXRATE=25.000+&COMPUTE=COMPUTE&CALCULATORID=HF09&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

3)

OLD

https://example.com/index.php?ORIGINALLOANAMOUNT=400%2C000.00&ORIGINALTERM=30&ORIGINALTERM_UNITS=Years&LOANSTARTMONTH=7&LOANSTARTYEAR=2018&CURRENTRATE=5.700+&CASHOUT=5%2C000.00&NEWRATE=5.250+&POINTS=1.000+&OTHERFEES=1%2C500.00&NEWTERM=30&NEWTERM_UNITS=Years&TAXRATE=28.000+&RATEOFRETURN=2.300+&BALLOONTERM=15&BALLOONTERM_UNITS=Years&COMPUTE=COMPUTE&CURRENTCOMPOUNDING=6&NEWCOMPOUNDING=6&CALCULATORID=HF01&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

NEW

https://example.com/index.php?page=should-i-refinance&ORIGINALLOANAMOUNT=400%2C000.00&ORIGINALTERM=30&ORIGINALTERM_UNITS=Years&LOANSTARTMONTH=7&LOANSTARTYEAR=2018&CURRENTRATE=5.700+&CASHOUT=5%2C000.00&NEWRATE=5.250+&POINTS=1.000+&OTHERFEES=1%2C500.00&NEWTERM=30&NEWTERM_UNITS=Years&TAXRATE=28.000+&RATEOFRETURN=2.300+&BALLOONTERM=15&BALLOONTERM_UNITS=Years&COMPUTE=COMPUTE&CURRENTCOMPOUNDING=6&NEWCOMPOUNDING=6&CALCULATORID=HF01&TEMPLATE_ID=www.abc.com_1&PostBack=true#results

  • Create an .htaccess file on your web server

Redirecting a URL

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. For example, if you use index.html as your index file and then later rename index.html to home.html, you could set up a redirect to send users from index.html to home.html.

For example:

Redirect to a local site file

Redirect /path/to/old/file/old.html /path/to/new/file/new.html

Redirect to an external site file

Redirect /path/to/old/file/old.html http://www.example.com/new/file/new.html

Examples of redirects

Redirect from an index.html file to a different directory

Redirect /index.html /new/

Redirect from index.html to default.html

Redirect /index.html /default.html

Redirect a local /private directory to another site's private directory

Redirect /private/ http://www.example.com/private/

Refer:https://help.dreamhost.com/hc/en-us/articles/215747748-How-can-I-redirect-and-rewrite-my-URLs-with-an-htaccess-file-