Knowledgebase
Nginx RewriteRules for Tube Script 5.0.14
Posted by Konrad Piwowar on 01 March 2016 11:56 AM

location / {
        root   /path/to/root/of/domain/;
        index  index.php index.html index.htm;
        rewrite ^/page([0-9]+).html$ /index.php?controller=index&page=$1;
        rewrite ^/galleries/(.*)-([0-9]+).html$ /index.php?controller=gallery&id=$2;
        rewrite ^/video/(.*)-([0-9]+).html$ /index.php?controller=video&id=$2;
        rewrite ^/signup$ /index.php?controller=signup;
        rewrite ^/upload$ /index.php?controller=upload;
        rewrite ^/upload_photo$ /index.php?controller=upload&option=photo;
        rewrite ^/login$ /index.php?controller=login;
        rewrite ^/logout$ /index.php?controller=logout;
        rewrite ^/contact$ /index.php?controller=contact;
        rewrite ^/forgot-pass$ /index.php?controller=forgot_pass;
        rewrite ^/my-profile$ /index.php?controller=my_profile;
        rewrite ^/my-friends$ /index.php?controller=my_friends;
        rewrite ^/my-friends/$ /index.php?controller=friends;
        rewrite ^/my-friends/page([0-9]+).html$ /index.php?controller=friends&page=$1;
        rewrite ^/edit-profile$ /index.php?controller=edit_profile;
        rewrite ^/edit-content/(.*)$ /index.php?controller=editContent&id=$1;
        rewrite ^/static/(.*)$ /index.php?controller=displayStatic&id=$1;
        rewrite ^/load/(.*)$ /index.php?controller=loadLayout&id=$1;
        rewrite ^/filter/(.*)$ /index.php?controller=setFilter&id=$1;
        rewrite ^/embed/([0-9]+)$ /index.php?controller=embed&id=$1;
        rewrite ^/dmca$ /index.php?controller=dmca;
        rewrite ^/tos$ /index.php?controller=tos;
        rewrite ^/crss/([0-9]+)$ /index.php?controller=crss&id=$1;
        rewrite ^/rss$ /index.php?controller=rss;
        rewrite ^/a/(.*)$ /index.php?controller=link&slug=$1;
        rewrite ^/(my-uploads|favorites|most-recent|most-discussed|most-viewed|longest|top-rated|photos|random|my-friends)/$ /index.php?controller=index&mode=$1;
        rewrite ^/(my-uploads|favorites|most-recent|most-discussed|most-viewed|longest|top-rated|photos|random|my-friends)/page([0-9]+).html$ /index.php?controller=index&mode=$1&page=$2;
        rewrite ^/(my-uploads|favorites|most-recent|most-discussed|most-viewed|longest|top-rated|photos|random|my-friends)/(day|week|month)/$ /index.php?controller=index&mode=$1&dateRange=$2;
        rewrite ^/(my-uploads|favorites|most-recent|most-discussed|most-viewed|longest|top-rated|photos|random|my-friends)/(day|week|month)/page([0-9]+).html$ /index.php?controller=index&mode=$1&dateRange=$2&page=3;
        rewrite ^/(my-uploads|favorites|most-recent|most-discussed|most-viewed|longest|top-rated|photos|random|my-friends)/page([0-9]+).html$ /index.php?controller=index&mode=$1&page=$2;
        rewrite ^/uploads-by-user/([0-9]+)/$ /index.php?controller=index&mode=uploads-by-user&user=$1;
        rewrite ^/uploads-by-user/([0-9]+)/page([0-9]+).html$ /index.php?controller=index&mode=uploads-by-user&user=$1&page=$2;
        rewrite ^/search/(videos|members|photos)/([A-Za-z0-9-\s]+)/$ /index.php?controller=index&mode=search&type=$1&q=$2&page=1;
        rewrite ^/search/(videos|members|photos)/([A-Za-z0-9-\s]+)/page([0-9]+).html$ /index.php?controller=index&mode=search&type=$1&q=$2&page=$3;
        rewrite ^/search/(videos|members|photos)/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/$ /index.php?controller=index&mode=search&type=$1&q=$2&page=1&sortby=$3;
        rewrite ^/search/(videos|members|photos)/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/page([0-9]+).html$ /index.php?controller=index&mode=search&type=$1&q=$2&page=$4&sortby=$3;
        rewrite ^/search/([A-Za-z0-9-\s]+)/$ /index.php?controller=index&mode=search&q=$1&page=1;
        rewrite ^/search/([A-Za-z0-9-\s]+)/page([0-9]+).html$ /index.php?controller=index&mode=search&q=$1&page=$2;
        rewrite ^/search/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/$ /index.php?controller=index&mode=search&q=$1&page=1&sortby=$2;
        rewrite ^/search/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/page([0-9]+).html$ /index.php?controller=index&mode=search&q=$1&page=$3&sortby=$2;
        rewrite ^/channels/$ /index.php?controller=channels;
        rewrite ^/channels/([0-9]+)/([A-Za-z0-9-\s]+)/$ /index.php?controller=index&mode=channel&channel=$1;
        rewrite ^/channels/([0-9]+)/([A-Za-z0-9-\s]+)/page(.*).html$ /index.php?mode=channel&channel=$1&page=$3;
        rewrite ^/channels/([0-9]+)/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/$ /index.php?controller=index&mode=channel&channel=$1&sortby=$3;
        rewrite ^/channels/([0-9]+)/([A-Za-z0-9-\s]+)/(newest|rating|views|longest)/page(.*).html$ /index.php?mode=channel&channel=$1&sortby=$2&page=$4;
        rewrite ^/models/$ /index.php?controller=pornstars;
        rewrite ^/models/page([0-9]+).html$ /index.php?controller=pornstars&page=$1;
        rewrite ^/models/([A-Za-z0-9-\s]+)/$ /index.php?controller=pornstars&letter=$1&page=1;
        rewrite ^/models/([A-Za-z0-9-\s]+)/page([0-9]+).html$ /index.php?controller=pornstars&letter=$1&page=$2;
        rewrite ^/models/(.*)-(.*).html$ /index.php?controller=pornstar_bio&id=$2;
        rewrite ^/pornstars/$ /index.php?controller=pornstars;
        rewrite ^/pornstars/page([0-9]+).html$ /index.php?controller=pornstars&page=$1;
        rewrite ^/pornstars/([A-Za-z0-9-\s]+)/$ /index.php?controller=pornstars&letter=$1&page=1;
        rewrite ^/pornstars/([A-Za-z0-9-\s]+)/page([0-9]+).html$ /index.php?controller=pornstars&letter=$1&page=$2;
        rewrite ^/pornstars/(.*)-(.*).html$ /index.php?controller=pornstar_bio&id=$2;
        rewrite ^/mailbox/$ /mailbox.php;
        rewrite ^/mailbox/([0-9]+)$ /mailbox.php?mode=inbox&page=$1;
        rewrite ^/mailbox/inbox/(.*)$ /mailbox.php?mode=inbox&page=$1;
        rewrite ^/mailbox/outbox/(.*)$ /mailbox.php?mode=outbox&page=$1;
        rewrite ^/mailbox/read/([0-9]+)$ /mailbox.php?mode=read&mid=$1;
        rewrite ^/mailbox/read/([0-9]+)/delete/$ /mailbox.php?mode=read&mid=$1&delete=true;
        rewrite ^/mailbox/read/([0-9]+)/spam/$ /mailbox.php?mode=read&mid=$1&spam=true;
        rewrite ^/mailbox/compose/(.*)/reply/$ /mailbox.php?mode=compose&mid=$1&reply=true;
        rewrite ^/mailbox/inbox/$ /mailbox.php?mode=inbox;
        rewrite ^/mailbox/outbox/$ /mailbox.php?mode=outbox;
        rewrite ^/mailbox/compose/$ /mailbox.php?mode=compose;
        rewrite ^/user/(.*)-(.*)/$ /index.php?controller=user_profile&id=$2;
        rewrite ^/members/$ /index.php?controller=members;
        rewrite ^/members/page([0-9]+).html$ /index.php?controller=members&page=$1;
    }

(3 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments: