htaccess to nginx rewrite

Jim Ohlstein jim.ohlstein at gmail.com
Wed Jan 21 16:18:28 MSK 2009


Note:

Should be 'permanent' not 'permnent' or you will probably get an error.

Jim

-----Original Message-----
From: owner-nginx at sysoev.ru [mailto:owner-nginx at sysoev.ru] On Behalf Of
Maxim Dounin
Sent: Wednesday, January 21, 2009 7:30 AM
To: nginx at sysoev.ru
Subject: Re: htaccess to nginx rewrite

Hello!

On Wed, Jan 21, 2009 at 09:57:19AM +0300, Igor Sysoev wrote:

> On Tue, Jan 20, 2009 at 08:25:06PM +0100, Vahid Mirjamali wrote:
> 
> > I've desperately tried to convert my htaccess to nginx but sadly I just
> > couldn't figure out how to do it. I really need help badly, I'm willing
> > to pay someone 15 dollars to just make my site work again on nginx if
> > someone can help me with that.
> > 
> > Attachments:
> > http://www.ruby-forum.com/attachment/3186/htaccess.zip
> 
> 
> Here is sample how to convert first several rules:

[...]

>     # RewriteCond %{HTTP_HOST} !^www\.pspcrazy\.com
>     # RewriteRule (.*) http://www.pspcrazy.com/$1 [R=301,L]
> 
>     server {
>         listen  80   default;
>         server_name  _;
> 
>         rewrite  ^  http://www.pspcrazy.com$request_uri  permnent;

-         rewrite  ^  http://www.pspcrazy.com$request_uri  permnent;
+         rewrite  ^  http://www.pspcrazy.com$request_uri?  permanent;

(added '?' to avoid query string duplication, typo fixed)

Maxim Dounin






More information about the nginx mailing list