Welcome! Log In Create A New Profile

Advanced

Rewrite help

Posted by st1905 
Rewrite help
September 05, 2009 02:25PM
Hi,

I`m struggling to convert the following to nginx rules, can you help me please ?

[code]
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 [L]
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 [L]
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 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name=$4 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$4&news_page=$2&cstart=$3 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$2 [L]
RewriteRule ^([^.]+)/print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3 [L]
RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3&news_page=$1&cstart=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2&news_page=$1 [L]
RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$1&newsid=$2 [L]
RewriteRule ^([0-9]+)-(.*).html(/?)+$ index.php?newsid=$1 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2&day=$3 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&day=$3&cstart=$4 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})(/?)+$ index.php?year=$1&month=$2 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/page/([0-9]+)(/?)+$ index.php?year=$1&month=$2&cstart=$3 [L]
RewriteRule ^([0-9]{4})(/?)+$ index.php?year=$1 [L]
RewriteRule ^([0-9]{4})/page/([0-9]+)(/?)+$ index.php?year=$1&cstart=$2 [L]
RewriteRule ^playvideo/([^/]*)(/?)+$ index.php?do=mp3search&load=playvideo&thuy=$1 [L]
RewriteRule ^attsearch/([^/]*)/([^/]*)/page/([0-9]+)(/?)+$ index.php?do=mp3search&key=$1&page=$3&type=$2 [L]
RewriteRule ^member/listenplaylist/([^/]*)/([0-9]+)(/?)+$ index.php?thuy=member&do=listenplaylist&name=$1&id=$2 [L]
RewriteRule ^songuploads.html$ index.php?do=mp3search&load=membersong [L]
RewriteRule ^playmusic/([^/]*)/([^/]*)/([^/]*)(/?)+$ index.php?do=mp3search&load=playmusic&key=$2&user=$1&thuy=$3 [L]
RewriteRule ^store/([^/]*)/([^/]*)(/?)+$ engine/mp3/mp3download.php?name=$2&url=$1 [L]
RewriteRule ^([^/]*)/music(/?)+$ index.php?do=mp3search&load=membersong&user=$1&page=1 [L]
RewriteRule ^([^/]*)/music/page/([0-9]+)(/?)+$ index.php?do=mp3search&load=membersong&user=$1&page=$2 [L]
RewriteRule ^([^/]*)/playlist/page/([0-9]+)(/?)+$ ?do=mp3search&key=UserPlaylist&page=$2&type=playlist&thuy=$1 [L]
RewriteRule ^mymusic/page/([0-9]+)(/?)+$ index.php?do=mp3search&load=mymusic&page=$1 [L]
RewriteRule ^mymusic(/?)+$ index.php?do=mp3search&load=mymusic&page=1 [L]
RewriteRule ^playlist(/?)+$ index.php?do=mp3search&key=AllPlaylist&page=1&type=playlist&thuy=all [L]
RewriteRule ^playlist/page/([0-9]+)(/?)(/?)+$ index.php?do=mp3search&key=AllPlaylist&page=$1&type=playlist&thuy=all [L]
RewriteRule ^statistics.html$ index.php?do=stats [L]
RewriteRule ^signup.html$ index.php?do=register [L]
RewriteRule ^addnews.html$ index.php?do=addnews [L]
RewriteRule ^rss.xml$ engine/rss.php [L]
RewriteRule ^sitemap.xml$ uploads/sitemap.xml [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)/page/([0-9]+)(/?)+$ index.php?do=cat&category=$1&cstart=$2 [L]
RewriteRule ^([^.]+)/?$ index.php?do=cat&category=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^<]+)/rss.xml$ engine/rss.php?do=cat&category=$1 [L]
RewriteRule ^page,([0-9]+),([^/]+).html$ index.php?do=static&page=$2&news_page=$1 [L]
RewriteRule ^([^/]+).html$ index.php?do=static&page=$1 [L]

[/code]


I`m struggling with the ones at very first (The rules at the begining). Thanks.



Edited 1 time(s). Last edit at 09/05/2009 02:26PM by st1905.
Re: Rewrite help
September 05, 2009 02:43PM
I have made a rule like this but not sure if its ok or not


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;



Edited 1 time(s). Last edit at 09/05/2009 02:44PM by st1905.
Re: Rewrite help
September 06, 2009 05:47PM
I have fixed this issue, thanks.
Re: Rewrite help
October 03, 2009 02:45PM
[code]
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 ^/playvideo/([^/]*)(/?)+$ /index.php?do=mp3search&load=playvideo&thuy=$1 last;
rewrite ^/attsearch/([^/]*)/([^/]*)/page/([0-9]+)(/?)+$ /index.php?do=mp3search&key=$1&page=$3&type=$2 last;
rewrite ^/member/listenplaylist/([^/]*)/([0-9]+)(/?)+$ /index.php?thuy=member&do=listenplaylist&name=$1&id=$2 last;
rewrite ^/songuploads.html$ /index.php?do=mp3search&load=membersong last;
rewrite ^/playmusic/([^/]*)/([^/]*)/([^/]*)(/?)+$ /index.php?do=mp3search&load=playmusic&key=$2&user=$1&thuy=$3 last;
rewrite ^/store/([^/]*)/([^/]*)(/?)+$ /engine/mp3/mp3download.php?name=$2&url=$1 last;
rewrite ^/([^/]*)/music(/?)+$ /index.php?do=mp3search&load=membersong&user=$1&page=1 last;
rewrite ^/([^/]*)/music/page/([0-9]+)(/?)+$ /index.php?do=mp3search&load=membersong&user=$1&page=$2 last;
rewrite ^/([^/]*)/playlist/page/([0-9]+)(/?)+$ /?do=mp3search&key=UserPlaylist&page=$2&type=playlist&thuy=$1 last;
rewrite ^/mymusic/page/([0-9]+)(/?)+$ /index.php?do=mp3search&load=mymusic&page=$1 last;
rewrite ^/mymusic(/?)+$ /index.php?do=mp3search&load=mymusic&page=1 last;
rewrite ^/playlist(/?)+$ /index.php?do=mp3search&key=AllPlaylist&page=1&type=playlist&thuy=all last;
rewrite ^/playlist/page/([0-9]+)(/?)(/?)+$ /index.php?do=mp3search&key=AllPlaylist&page=$1&type=playlist&thuy=all last;
rewrite ^/statistics.html$ /index.php?do=stats last;
rewrite ^/signup.html$ /index.php?do=register 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_36 1$rule_36;
}
if ($rule_36 = "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_38 1$rule_38;
}
if ($rule_38 = "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 ^/([^/]+).html$ /index.php?do=static&page=$1 last;

[/code]

Webmaster of www.Pic-City.de
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 155
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready