11 messages in ru.sysoev.nginxRe: htaccess to nginx rewrite
FromSent OnAttachments
Vahid MirjamaliJan 20, 2009 11:24 am 
Igor SysoevJan 20, 2009 10:56 pm 
Maxim DouninJan 21, 2009 4:29 am 
Jim OhlsteinJan 21, 2009 5:18 am 
Vahid MirjamaliJan 21, 2009 11:10 pm 
Igor SysoevJan 21, 2009 11:32 pm 
Igor SysoevJan 21, 2009 11:39 pm 
Vahid MirjamaliJan 27, 2009 1:11 pm 
Vahid MirjamaliJan 27, 2009 1:12 pm 
Igor SysoevJan 28, 2009 2:14 am 
Igor SysoevJan 28, 2009 2:28 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: htaccess to nginx rewriteActions...
From:Igor Sysoev (is@rambler-co.ru)
Date:Jan 20, 2009 10:56:56 pm
List:ru.sysoev.nginx

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]

RewriteRule ^game-browser-([^/]*)-([^/]*)-([0-9]*)-([^/]*)-([^/]*)-([^/]*).html index.php?page=BrowseGames&start=$1&cat=$2&nav=$3&genre=$4&esrb=$5&publisher=$6 [L,NS] RewriteRule ^image_upload.html index.php?page=Mediaupload [L,NS] RewriteRule ^image_upload-go.html index.php?page=Mediaupload&action=go [L,NS] RewriteRule ^image_upload-go-ADD.html index.php?page=Mediaupload&action=go&task= upload [L,NS]

server { listen 80; server_name www.pspcrazy.com;

location ~ \.php$ { ... }

# RewriteRule
^game-browser-([^/]*)-([^/]*)-([0-9]*)-([^/]*)-([^/]*)-([^/]*).html
index.php?page=BrowseGames&start=$1&cat=$2&nav=$3&genre=$4&esrb=$5&publisher=$6
[L,NS]

location /game-browser- { rewrite
^/game-browser-([^/]*)-([^/]*)-([0-9]*)-([^/]*)-([^/]*)-([^/]*).html /index.php?page=BrowseGames&start=$1&cat=$2&nav=$3&genre=$4&esrb=$5&publisher=$6? last; }

# RewriteRule ^image_upload.html index.php?page=Mediaupload [L,NS]

location = /image_upload.html { rewrite ^ /index.php?page=Mediaupload last; }

... }

# 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; }

Other rules should converted as these first ones.