# Problem with nginx rewrite rule

**URL:** <https://www.ruby-forum.com/t/problem-with-nginx-rewrite-rule/187084>\
**Category:** NGINX\
**Created:** [April 16, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/problem-with-nginx-rewrite-rule/187084 "2010-04-16T18:20:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![st1905](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@st1905](https://www.ruby-forum.com/u/st1905)\
**Post date:** [April 16, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/problem-with-nginx-rewrite-rule/187084/1 "2010-04-16T18:20:46Z")

</div>

Hello,

Here is the rule from apache

RewriteRule ^ats-plug-helper.php/?$ includes/ats.php

and here is my rule for nginx

rewrite ^/ats-plug-helper.php/?$ /includes/ats.php last ;

I`m using php-fpm for php files.

The problem is url works [www.domain.com/ats-plug-helper.php/](http://www.domain.com/ats-plug-helper.php/) but not  
with [www.domain.com/ats-plug-helper.php](http://www.domain.com/ats-plug-helper.php)

Can you please tell me what i`m missing here ?

Thanks

Posted at Nginx Forum:

> **[Problem with nginx rewrite rule](https://forum.nginx.org/read.php?2,75803,75803#msg-75803)**
>
> Hello, Here is the rule from apache RewriteRule ^ats-plug-helper.php/?$ includes/ats.php and here is my rule for nginx rewrite ^/ats-plug-helper.php/?$ /includes/ats.php last ; I\`m using php-fpm for php files.

---

<div class="post-metadata">

**Author:** ![st1905](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/35a633/32.png) [@st1905](https://www.ruby-forum.com/u/st1905)\
**Post date:** [April 16, 2010, 7:07pm UTC](https://www.ruby-forum.com/t/problem-with-nginx-rewrite-rule/187084/2 "2010-04-16T19:07:02Z")

</div>

Never mind, i fixed it on my own.

location /ats-plug-helper.php {  
rewrite ^/ats-plug-helper.php/?$ /includes/ats.php last ;  
}

Posted at Nginx Forum:

> **[Re: Problem with nginx rewrite rule](https://forum.nginx.org/read.php?2,75803,75819#msg-75819)**
>
> Hello, Here is the rule from apache RewriteRule ^ats-plug-helper.php/?$ includes/ats.php and here is my rule for nginx rewrite ^/ats-plug-helper.php/?$ /includes/ats.php last ; I\`m using php-fpm for php files.
