How to add question mark to .htaccess?

Member

by domenico , in category: Third Party Scripts , 3 months ago

How to add question mark to .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cortez.connelly , 3 months ago

@domenico 

To add a question mark "?" to a .htaccess file, you can simply include it as part of the URL query string. For example, if you want to redirect a URL containing a question mark to a different page, you can add the following code to your .htaccess file:

1
Redirect 301 /old-page.php?param=value http://www.example.com/new-page.php


In this example, the question mark "?" is used to separate the URL path from the query string parameters, and the Redirect directive is being used to redirect any requests for "old-page.php?param=value" to "http://www.example.com/new-page.php".


Remember to always make a backup of your .htaccess file before making any changes.