Problem with .htaccess

hello

i have a problem with .htaccess file not workin with nGinx

here is is code

RewriteEngine On
RewriteCond %{HTTP_HOST} !^vb.sitename.com
RewriteCond %{REQUEST_FILENAME} vb/
RewriteRule (.*) http://vb.dardarkom.com/$1

RewriteRule ^page/(.*)$ index.php?cstart=$1

RewriteRule
^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.).html(/?)+$
index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6
RewriteRule
^([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.
).html(/?)+$
index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5
RewriteRule
^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.).html(/?)+$
engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.
).html(/?)+$
index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4

RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.).html(/?)+$
index.php?newsid=$4&news_page=$2&cstart=$3
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.
).html(/?)+$
index.php?newsid=$3&news_page=$2
RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.).html(/?)+$
engine/print.php?news_page=$2&newsid=$3
RewriteRule ^([^.]+)/([0-9]+)-(.
).html(/?)+$ index.php?newsid=$2

RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.).html(/?)+$
index.php?newsid=$3&news_page=$1&cstart=$2
RewriteRule ^page,([0-9]+),([0-9]+)-(.
).html(/?)+$
index.php?newsid=$2&news_page=$1
RewriteRule ^print:page,([0-9]+),([0-9]+)-(.).html(/?)+$
engine/print.php?news_page=$1&newsid=$2
RewriteRule ^([0-9]+)-(.
).html(/?)+$ index.php?newsid=$1

RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$
index.php?year=$1&month=$2&day=$3
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$
index.php?year=$1&month=$2&day=$3&cstart=$4

RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2
RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$
index.php?year=$1&month=$2&cstart=$3

RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1
RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2

RewriteRule ^tags/([^/])(/?)+$ index.php?do=tags&tag=$1
RewriteRule ^tags/([^/]
)/page/([0-9]+)(/?)+$
index.php?do=tags&tag=$1&cstart=$2

RewriteRule ^user/([^/])/rss.xml$
engine/rss.php?subaction=allnews&user=$1
RewriteRule ^user/([^/]
)(/?)+$ index.php?subaction=userinfo&user=$1
RewriteRule ^user/([^/])/page/([0-9]+)(/?)+$
index.php?subaction=userinfo&user=$1&cstart=$2
RewriteRule ^user/([^/]
)/news(/?)+$ index.php?subaction=allnews&user=$1
RewriteRule ^user/([^/])/news/page/([0-9]+)(/?)+$
index.php?subaction=allnews&user=$1&cstart=$2
RewriteRule ^user/([^/]
)/news/rss.xml(/?)+$
engine/rss.php?subaction=allnews&user=$1

RewriteRule ^lastnews/(/?)+$ index.php?do=lastnews
RewriteRule ^lastnews/page/([0-9]+)(/?)+$
index.php?do=lastnews&cstart=$1

RewriteRule ^catalog/([^/])(/?)+$ index.php?catalog=$1
RewriteRule ^catalog/([^/]
)/page/([0-9]+)(/?)+$
index.php?catalog=$1&cstart=$2

RewriteRule ^newposts(/?)+$ index.php?subaction=newposts
RewriteRule ^newposts/page/([0-9]+)(/?)+$
index.php?subaction=newposts&cstart=$1

RewriteRule ^static/(.*).html(/?)+$ index.php?do=static&page=$1

RewriteRule ^favorites(/?)+$ index.php?do=favorites
RewriteRule ^favorites/page/([0-9]+)(/?)+$
index.php?do=favorites&cstart=$1

RewriteRule ^rules.html$ index.php?do=rules
RewriteRule ^statistics.html$ index.php?do=stats
RewriteRule ^addnews.html$ index.php?do=addnews
RewriteRule ^rss.xml$ engine/rss.php
RewriteRule ^sitemap.xml$ uploads/sitemap.xml

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$
index.php?do=cat&category=$1&cstart=$2
RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^<]+)/rss.xml$ engine/rss.php?do=cat&category=$1
RewriteRule ^page,([0-9]+),([^/]+).html$
index.php?do=static&page=$2&news_page=$1
RewriteRule ^print:([^/]+).html$ engine/print.php?do=static&page=$1

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+).html$ index.php?do=static&page=$1

i would be apprecaited if someone recode this .htaccess with nGinx Rules

thanks

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,78233,78233#msg-78233

if ($http_host !~ “^vb.sitename.com”){
set $rule_0 1$rule_0;
}
if ($request_filename ~ “vb/”){
set $rule_0 2$rule_0;
}
if ($rule_0 = “21”){
rewrite /(.) http://vb.dardarkom.com/$1 permanent;
break;
}
rewrite ^/page/(.
)$ /index.php?cstart=$1 last;
rewrite
^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.).html(/?)+$
/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6
last;
rewrite
^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page,([0-9]+),(.
).html(/?)+$
/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5
last;
rewrite
^/([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(.).html(/?)+$
/engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5
last;
rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.
).html(/?)+$
/index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 last;
rewrite ^/([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.).html(/?)+$
/index.php?newsid=$4&news_page=$2&cstart=$3 last;
rewrite ^/([^.]+)/page,([0-9]+),([0-9]+)-(.
).html(/?)+$
/index.php?newsid=$3&news_page=$2 last;
rewrite ^/([^.]+)/print:page,([0-9]+),([0-9]+)-(.).html(/?)+$
/engine/print.php?news_page=$2&newsid=$3 last;
rewrite ^/([^.]+)/([0-9]+)-(.
).html(/?)+$ /index.php?newsid=$2 last;
rewrite ^/page,([0-9]+),([0-9]+),([0-9]+)-(.).html(/?)+$
/index.php?newsid=$3&news_page=$1&cstart=$2 last;
rewrite ^/page,([0-9]+),([0-9]+)-(.
).html(/?)+$
/index.php?newsid=$2&news_page=$1 last;
rewrite ^/print:page,([0-9]+),([0-9]+)-(.).html(/?)+$
/engine/print.php?news_page=$1&newsid=$2 last;
rewrite ^/([0-9]+)-(.
).html(/?)+$ /index.php?newsid=$1 last;
rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$
/index.php?year=$1&month=$2&day=$3 last;
rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$
/index.php?year=$1&month=$2&day=$3&cstart=$4 last;
rewrite ^/([0-9]{4})/([0-9]{2})(/?)+$ /index.php?year=$1&month=$2
last;
rewrite ^/([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$
/index.php?year=$1&month=$2&cstart=$3 last;
rewrite ^/([0-9]{4})(/?)+$ /index.php?year=$1 last;
rewrite ^/([0-9]{4})/page/([0-9]+)(/?)+$ /index.php?year=$1&cstart=$2
last;
rewrite ^/tags/([^/])(/?)+$ /index.php?do=tags&tag=$1 last;
rewrite ^/tags/([^/]
)/page/([0-9]+)(/?)+$
/index.php?do=tags&tag=$1&cstart=$2 last;
rewrite ^/user/([^/])/rss.xml$
/engine/rss.php?subaction=allnews&user=$1 last;
rewrite ^/user/([^/]
)(/?)+$ /index.php?subaction=userinfo&user=$1
last;
rewrite ^/user/([^/])/page/([0-9]+)(/?)+$
/index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite ^/user/([^/]
)/news(/?)+$ /index.php?subaction=allnews&user=$1
last;
rewrite ^/user/([^/])/news/page/([0-9]+)(/?)+$
/index.php?subaction=allnews&user=$1&cstart=$2 last;
rewrite ^/user/([^/]
)/news/rss.xml(/?)+$
/engine/rss.php?subaction=allnews&user=$1 last;
rewrite ^/lastnews/(/?)+$ /index.php?do=lastnews last;
rewrite ^/lastnews/page/([0-9]+)(/?)+$
/index.php?do=lastnews&cstart=$1 last;
rewrite ^/catalog/([^/])(/?)+$ /index.php?catalog=$1 last;
rewrite ^/catalog/([^/]
)/page/([0-9]+)(/?)+$
/index.php?catalog=$1&cstart=$2 last;
rewrite ^/newposts(/?)+$ /index.php?subaction=newposts last;
rewrite ^/newposts/page/([0-9]+)(/?)+$
/index.php?subaction=newposts&cstart=$1 last;
rewrite ^/static/(.*).html(/?)+$ /index.php?do=static&page=$1 last;
rewrite ^/favorites(/?)+$ /index.php?do=favorites last;
rewrite ^/favorites/page/([0-9]+)(/?)+$
/index.php?do=favorites&cstart=$1 last;
rewrite ^/rules.html$ /index.php?do=rules last;
rewrite ^/statistics.html$ /index.php?do=stats last;
rewrite ^/addnews.html$ /index.php?do=addnews last;
rewrite ^/rss.xml$ /engine/rss.php last;
rewrite ^/sitemap.xml$ /uploads/sitemap.xml last;
if (!-d $request_filename){
set $rule_42 1$rule_42;
}
if ($rule_42 = “1”){
rewrite ^/([^.]+)/page/([0-9]+)(/?)+$
/index.php?do=cat&category=$1&cstart=$2 last;
}
rewrite ^/([^.]+)/?$ /index.php?do=cat&category=$1 last;
if (!-f $request_filename){
set $rule_44 1$rule_44;
}
if ($rule_44 = “1”){
rewrite ^/([^<]+)/rss.xml$ /engine/rss.php?do=cat&category=$1 last;
}
rewrite ^/page,([0-9]+),([^/]+).html$
/index.php?do=static&page=$2&news_page=$1 last;
rewrite ^/print:([^/]+).html$ /engine/print.php?do=static&page=$1
last;
if (!-f $request_filename){
set $rule_47 1$rule_47;
}
if ($rule_47 = “1”){
rewrite ^/([^/]+).html$ /index.php?do=static&page=$1 last;
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,78233,78768#msg-78768

-------- Original-Nachricht --------

Datum: Sat, 24 Apr 2010 08:35:32 -0400
Von: “st1905” [email protected]
An: [email protected]
Betreff: Re: problem with .htaccess

}
rewrite ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.).html(/?)+$
rewrite ^/page,([0-9]+),([0-9]+)-(.
).html(/?)+$
/index.php?year=$1&month=$2&cstart=$3 last;
/index.php?subaction=userinfo&user=$1&cstart=$2 last;
rewrite ^/catalog/([^/]*)/page/([0-9]+)(/?)+$
rewrite ^/addnews.html$ /index.php?do=addnews last;
if (!-f $request_filename){
}
if ($rule_47 = “1”){
rewrite ^/([^/]+).html$ /index.php?do=static&page=$1 last;
}

You forgot to mention the problem.

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,78233,78768#msg-78768


nginx mailing list
[email protected]
http://nginx.org/mailman/listinfo/nginx


GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

I would convert this to a single controller file and handle it in app
logic. Talk about an ugly mess :slight_smile: I try to reduce the configuration
of the server as much as possible.

I’d make a single front controller and then use nginx’s try_files.
Clean and simple :slight_smile:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs