Score:0

How to add apache server config rewrite rule for encoding pipe symbol in url

gq flag

I am getting a 404 error on URL that contains pipe symbol. If I encode manually with %7C for pipe it works properly. I want to add a rule in Apache conf file that automatically replaces pipe character anywhere in the URL with %7C.

Ex: (Not working)

www.example.com/search/?term=test&another=1|2|3

This above URL works if changed as below,

www.example.com/search/?term=test&another=1%7C2%7C3

(URL needs in this format)

Your help is greatly appreciated.

Ptit Xav avatar
pn flag
May you can find useful idea [there](https://stackoverflow.com/a/22114892/13944750)
Score:0
ar flag

I want to add a rule in Apache conf file that automatically replaces pipe character anywhere in the URL with %7C.

You have to do the replacement client side. You can't do it server side. It's too late at that stage - you have to do it before the client sends the request. | is not a valid character.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.