# Please help rewrite proper parameter

**URL:** <https://www.ruby-forum.com/t/please-help-rewrite-proper-parameter/244311>\
**Category:** NGINX\
**Created:** [March 20, 2016, 3:56pm UTC](https://www.ruby-forum.com/t/please-help-rewrite-proper-parameter/244311 "2016-03-20T15:56:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [March 20, 2016, 3:56pm UTC](https://www.ruby-forum.com/t/please-help-rewrite-proper-parameter/244311/1 "2016-03-20T15:56:35Z")

</div>

Hi,

Sometimes, bots are notorious for doing that, arguments are over  
urlencoded.  
If someone knew a way to rewrite them back to their normal state, that  
would be awesome.

e.g.

Normal URL: [Custom Application Development Software for Business - Salesforce.com](http://www.site.com/file.php?param=blahblah)

URLs that bots try sometimes (often in fact - don’t know where they get  
those strings BTW):

> **[Overview](https://www.salesforce.com/products/platform/overview/?d=70130000000liBh&internal=true&bc=HA)**
>
> Go digital fast and empower your teams to work from anywhere. Develop scalable, custom business apps with low-code development or give your teams the tools to build with services and APIs.

> **[Overview](https://www.salesforce.com/products/platform/overview/?d=70130000000liBh&internal=true&bc=HA)**
>
> Go digital fast and empower your teams to work from anywhere. Develop scalable, custom business apps with low-code development or give your teams the tools to build with services and APIs.

> **[Overview](https://www.salesforce.com/products/platform/overview/?d=70130000000liBh&internal=true&bc=HA)**
>
> Go digital fast and empower your teams to work from anywhere. Develop scalable, custom business apps with low-code development or give your teams the tools to build with services and APIs.

…

Tried the following in the general filter block, then into the php  
block,  
didn’t help:

rewrite ^(._)(param)%(25)+(3D)(._)$ $1$2=$5 redirect;  
rewrite ^(._)(param)=(._)$ $1$2=$3 redirect;

Thanks!

Posted at Nginx Forum:

> **[Please help rewrite proper parameter](https://forum.nginx.org/read.php?2,265514,265514#msg-265514)**
>
> Hi, Sometimes, bots are notorious for doing that, arguments are over urlencoded. If someone knew a way to rewrite them back to their normal state, that would be awesome. e.g. Normal URL: www.site.com/file.php?param=blahblah URLs that bo

---

<div class="post-metadata">

**Author:** ![shiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/958977/32.png) [@shiz](https://www.ruby-forum.com/u/shiz)\
**Post date:** [April 29, 2016, 8:11pm UTC](https://www.ruby-forum.com/t/please-help-rewrite-proper-parameter/244311/2 "2016-04-29T20:11:00Z")

</div>

For reference, that snippet seem to have done the job.  
I’m not redirecting them, I trash them though.

if ($args ~\* “^param%”){  
access\_log off;  
return 410;  
}

Posted at Nginx Forum:

> **[Re: Please help rewrite proper parameter](https://forum.nginx.org/read.php?2,265514,266528#msg-266528)**
>
> Hi, Sometimes, bots are notorious for doing that, arguments are over urlencoded. If someone knew a way to rewrite them back to their normal state, that would be awesome. e.g. Normal URL: www.site.com/file.php?param=blahblah URLs that bo
