# Please convert this .htaccess to NGINX Rewrite

**URL:** <https://www.ruby-forum.com/t/please-convert-this-htaccess-to-nginx-rewrite/203376>\
**Category:** NGINX\
**Created:** [February 18, 2011, 5:43pm UTC](https://www.ruby-forum.com/t/please-convert-this-htaccess-to-nginx-rewrite/203376 "2011-02-18T17:43:42Z")\
**Posts on this page:** 3\
**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:** [February 18, 2011, 5:43pm UTC](https://www.ruby-forum.com/t/please-convert-this-htaccess-to-nginx-rewrite/203376/1 "2011-02-18T17:43:42Z")

</div>

RewriteEngine Off

could somebody convert this .htaccess to NGINX rewrite,??

Header set Cache-Control “max-age=29030400”

ExpiresActive On  
ExpiresDefault A604800  
ExpiresByType text/css A604800  
ExpiresByType image/gif A604800  
ExpiresByType image/png A604800  
ExpiresByType image/jpeg A604800  
ExpiresByType application/x-shockwave-flash A604800

if u could help me, i’ll be glad and u’re the best !  
thx

Posted at Nginx Forum:

> **[please convert this .htaccess to NGINX Rewrite](https://forum.nginx.org/read.php?2,176511,176511#msg-176511)**
>
> \<IfModule mod\_rewrite.c\> RewriteEngine Off \</IfModule\> could somebody convert this .htaccess to NGINX rewrite,,?? \<IfModule mod\_headers.c\> \<FilesMatch "\\.(gif|jpg|png|css|swf)$"\> Header set Cache-Control "ma

---

<div class="post-metadata">

**Author:** ![escavern](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/5f9b8f/32.png) [@escavern](https://www.ruby-forum.com/u/escavern)\
**Post date:** [February 20, 2011, 2:25am UTC](https://www.ruby-forum.com/t/please-convert-this-htaccess-to-nginx-rewrite/203376/2 "2011-02-20T02:25:33Z")

</div>

heloo, does anyone knows?? pls help me

Posted at Nginx Forum:

> **[Re: please convert this .htaccess to NGINX Rewrite](https://forum.nginx.org/read.php?2,176511,176904#msg-176904)**
>
> \<IfModule mod\_rewrite.c\> RewriteEngine Off \</IfModule\> could somebody convert this .htaccess to NGINX rewrite,,?? \<IfModule mod\_headers.c\> \<FilesMatch "\\.(gif|jpg|png|css|swf)$"\> Header set Cache-Control "ma

---

<div class="post-metadata">

**Author:** ![escavern](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/5f9b8f/32.png) [@escavern](https://www.ruby-forum.com/u/escavern)\
**Post date:** [February 20, 2011, 2:46pm UTC](https://www.ruby-forum.com/t/please-convert-this-htaccess-to-nginx-rewrite/203376/3 "2011-02-20T14:46:42Z")

</div>

There are plenty of example around the web. Search something like “nginx  
static content expires”:

Here is one example:

> <https://serverfault.com/questions/23157/setting-the-expires-http-header-for-static-content-served-from-nginx>

Posted at Nginx Forum:

> **[Re: please convert this .htaccess to NGINX Rewrite](https://forum.nginx.org/read.php?2,176511,176968#msg-176968)**
>
> \<IfModule mod\_rewrite.c\> RewriteEngine Off \</IfModule\> could somebody convert this .htaccess to NGINX rewrite,,?? \<IfModule mod\_headers.c\> \<FilesMatch "\\.(gif|jpg|png|css|swf)$"\> Header set Cache-Control "ma
