A
A
applecode2018-09-01 20:28:24
htaccess
applecode, 2018-09-01 20:28:24

How to avoid replacing square brackets in page url using htaccess?

I'm trying to display square brackets in url with this line

RewriteCond %{QUERY_STRING} ^(|.*?&)cake(=.*)$
RewriteRule ^(.*)$  /$1?%1food\[\]%2 [R=302,L]

However, if this code is repeated, then the square brackets at the end are replaced by the characters %255b%255d.
Can this be avoided?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2018-09-01
@dodo512

Add NE Flag

RewriteCond %{QUERY_STRING} ^(|.*?&)cake(=.*)$
RewriteRule ^(.*)$  /$1?%1food[]%2 [R=302,L,NE]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question