ASH
ASH

Reputation: 253

how to allow a "?" in a .htaccess file?

I've been trying to figure out how to allow a question mark in a url with parameters using htaccess rewrite.

I'm looking for something like this:

https://website.com/auth?login=yes&redirecturl=www.google.com 

keep in mind this is just an example of what i'm trying to accomplish.

here is the rewrite file.

RewriteEngine On

RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?key=$1

RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?key=$1

Thanks in advance for the help..

Upvotes: 1

Views: 61

Answers (3)

Robo Robok
Robo Robok

Reputation: 22845

I have a feeling that you just want to keep GET parameters.

Take a look at this: http://httpd.apache.org/docs/2.4/rewrite/flags.html#flag_qsa

Upvotes: 1

Overmind
Overmind

Reputation: 169

You must use Url Encode

So your "?" symbol should become %3F, a "&" should be %26, "\" -- %5C.

Upvotes: 0

Alexandre W.
Alexandre W.

Reputation: 38

It need to be escaped: index.php\?key=$1

Upvotes: 0

Related Questions