# Need help to convert rewrite url apache's

**URL:** <https://www.ruby-forum.com/t/need-help-to-convert-rewrite-url-apaches/206247>\
**Category:** NGINX\
**Created:** [April 26, 2011, 4:08pm UTC](https://www.ruby-forum.com/t/need-help-to-convert-rewrite-url-apaches/206247 "2011-04-26T16:08:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 26, 2011, 4:08pm UTC](https://www.ruby-forum.com/t/need-help-to-convert-rewrite-url-apaches/206247/1 "2011-04-26T16:08:09Z")

</div>

Hi All,

I’am new user, so actually I test NGinX in my labs for delete apache2 in  
my production webserver. I’ve small htaccess rules and I want to convert  
it in NGinX rewrite rule.

RewriteRule ^$ index.html [QSA]  
RewriteRule ^([^.]+)$ $1.html [QSA]  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteRule ^(.\*)$ index.php [QSA,L]

If anyone can help me please ?

Thank you in advance 🙂

Posted at Nginx Forum:

> **[Need help to convert rewrite url apache's](https://forum.nginx.org/read.php?2,193799,193799#msg-193799)**
>
> Hi All, I'am new user, so actually I test NGinX in my labs for delete apache2 in my production webserver. I've small htaccess rules and I want to convert it in NGinX rewrite rule. RewriteRule ^$ index.html \[QSA\] RewriteRule ^(\[^.\]+)$ $1.html \[QSA\] Re

---

<div class="post-metadata">

**Author:** ![Gimly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@Gimly](https://www.ruby-forum.com/u/Gimly)\
**Post date:** [April 26, 2011, 8:43pm UTC](https://www.ruby-forum.com/t/need-help-to-convert-rewrite-url-apaches/206247/2 "2011-04-26T20:43:51Z")

</div>

On Tue, Apr 26, 2011 at 10:07:33AM -0400, Gimly wrote:

> If anyone can help me please ?

location = / {  
try\_files /index.html =404;  
}

location / {  
try\_files $uri $uri.html /index.php;  
}

location = /index.php {  
fastcgi\_pass …  
fastcgi\_param SCRIPT\_FILENAME /path/to/index.php;  
include fastcgi\_params;  
}

–  
Igor S.

---

<div class="post-metadata">

**Author:** ![Gimly](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/e495f1/32.png) [@Gimly](https://www.ruby-forum.com/u/Gimly)\
**Post date:** [April 28, 2011, 7:43am UTC](https://www.ruby-forum.com/t/need-help-to-convert-rewrite-url-apaches/206247/3 "2011-04-28T07:43:48Z")

</div>

Thank you Igor !

I’ll test it today, and I’ll say you if it’s ok 🙂

Posted at Nginx Forum:

> **[Re: Need help to convert rewrite url apache's](https://forum.nginx.org/read.php?2,193799,194182#msg-194182)**
>
> Hi All, I'am new user, so actually I test NGinX in my labs for delete apache2 in my production webserver. I've small htaccess rules and I want to convert it in NGinX rewrite rule. RewriteRule ^$ index.html \[QSA\] RewriteRule ^(\[^.\]+)$ $1.html \[QSA\] Re
