# Url rewriting problem

**URL:** <https://www.ruby-forum.com/t/url-rewriting-problem/201032>\
**Category:** NGINX\
**Created:** [December 28, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/url-rewriting-problem/201032 "2010-12-28T19:12:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [December 28, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/url-rewriting-problem/201032/1 "2010-12-28T19:12:10Z")

</div>

Hi,  
I’m new to nginx, and I need to use many scripts which use apache2  
rewrite rules.

One of my script use two htaccess:

```auto
find /var/www/vhosts/mysite.com/httpdocs/ -name .htaccess
./manager/install/.htaccess
./manager/.htaccess
```

./manager/install/.htaccess =\> [RewriteEngine on# exclude real directories and filesRewriteCond %{REQUEST - Pastebin.com](http://pastebin.com/2S2dh0NL)

I tried:

```auto
location ^~ /install/ {
                root
/var/www/vhosts/mysite.com/httpdocs/manager/install;
                if (!-e $request_filename)
                {
                        return 403;
                }
                rewrite ^domains /index.php?page=domains break;
                rewrite (.*)\.php /index.php?page=$1&$query_string
break;
        }
```

Result:

- [http://www.mysite.com/manager/install.php](http://www.mysite.com/manager/install.php) not working
- [http://www.mysite.com/manager/index.php?page=install](http://www.mysite.com/manager/index.php?page=install) is working

so there is a problem.

./manager/.htaccess =\> [RewriteEngine on# exclude real directories and filesRewriteCond %{REQUEST - Pastebin.com](http://pastebin.com/u55eCFYA)

Still didn’t try, i need to setup my script first.

Thanks for your help !

Posted at Nginx Forum:

> **[url rewriting problem](https://forum.nginx.org/read.php?2,161768,161768#msg-161768)**
>
> Hi, I'm new to nginx, and I need to use many scripts which use apache2 rewrite rules. One of my script use two htaccess: \[code\] find /var/www/vhosts/mysite.com/httpdocs/ -name .htaccess ./manager/install/.htaccess ./manager/.htaccess \[
