How to add question mark to .htaccess?

Member

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

How to add question mark to .htaccess?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by cortez.connelly , 9 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.

Related Threads:

How to properly escape question mark in regex?
How to add a link to .htaccess?
How to add below security headers in .htaccess wordpress?
How to add .php extension in htaccess in laravel?
How to add https via .htaccess file?
How to add a parameter to a url using .htaccess without breaking in wordpress?