Announcement

Collapse
No announcement yet.

Nginx rewrite rules for tablet theme

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nginx rewrite rules for tablet theme

    Code:
    # global ---------------------------------------------------------------------------------------------------------------
    
    rewrite ^/terms/$ /terms.php last;
    rewrite ^/dmca/$  /dmca.php last;
    rewrite ^/2257/$  /2257.php last;
    
    rewrite ^/link/([^/]+)/$  /redirect_cs.php?dir=$1 last;
    
    rewrite ^/random_video(/)?$ /redirect_random_video.php last;
    rewrite ^/random_album(/)?$ /redirect_random_album.php last;
    
    # videos ---------------------------------------------------------------------------------------------------------------
    
    rewrite ^/([0-9]+)/$                    /index.php?from=$1 last;
    rewrite ^/$                             /index.php last;
    
    rewrite ^/top-rated/([0-9]+)/$          /index.php?sort_by=rating&from=$1 last;
    rewrite ^/top-rated/$                   /index.php?sort_by=rating last;
    
    rewrite ^/most-popular/([0-9]+)/$       /index.php?sort_by=video_viewed&from=$1 last;
    rewrite ^/most-popular/$                /index.php?sort_by=video_viewed last;
    
    rewrite ^/longest/([0-9]+)/$            /index.php?sort_by=duration&from=$1 last;
    rewrite ^/longest/$                     /index.php?sort_by=duration last;
    
    rewrite ^/most-commented/([0-9]+)/$     /index.php?sort_by=most_commented&from=$1 last;
    rewrite ^/most-commented/$              /index.php?sort_by=most_commented last;
    
    rewrite ^/most-favourited/([0-9]+)/$    /index.php?sort_by=most_favourited&from=$1 last;
    rewrite ^/most-favourited/$             /index.php?sort_by=most_favourited last;
    
    rewrite ^/categories/([^/]+)/([0-9]+)/$ /index.php?category=$1&from=$2 last;
    rewrite ^/categories/([^/]+)/$          /index.php?category=$1 last;
    
    rewrite ^/models/([^/]+)/([0-9]+)/$     /index.php?model=$1&from=$2 last;
    rewrite ^/models/([^/]+)/$              /index.php?model=$1 last;
    
    rewrite ^/tags/([^/]+)/([0-9]+)/$       /index.php?tag=$1&from=$2 last;
    rewrite ^/tags/([^/]+)/$                /index.php?tag=$1 last;
    
    rewrite ^/search/([^/]+)/([0-9]+)/$     /index.php?q=$1&from=$2 last;
    rewrite ^/search/([^/]+)/$              /index.php?q=$1 last;
    rewrite ^/search/$                      /index.php last;
    
    rewrite ^/rss/$                    /rss_videos.php last;
    rewrite ^/rss/tags/([^/]+)/$       /rss_videos.php?tag=$1 last;
    rewrite ^/rss/categories/([^/]+)/$ /rss_videos.php?category=$1 last;
    rewrite ^/rss/models/([^/]+)/$     /rss_videos.php?model=$1 last;
    
    rewrite ^/videos/([0-9]+)/([^/]+)/$ /view_video.php?id=$1&dir=$2 last;
    rewrite ^/videos/([^/]+)/$          /view_video.php?dir=$1 last;
    
    # memberzone -----------------------------------------------------------------------------------------------------------
    
    rewrite ^/my/favourites/([0-9]+)/$ /my_profile_view.php?from=$1 last;
    rewrite ^/my/favourites/$          /my_profile_view.php last;
    
    rewrite ^/logout/$          /logout.php last;
    rewrite ^/email/$           /email_links.php last;
    rewrite ^/login/$           /index.php?mode=async&function=get_block&block_id=logon_logon_form&global=true last;
    rewrite ^/login-required/$  /index.php?mode=async&function=get_block&block_id=logon_logon_form&global=true&error=only_for_members last;
    rewrite ^/signup/$          /index.php?mode=async&function=get_block&block_id=signup_signup_form_simple&global=true last;
    rewrite ^/reset-password/$  /index.php?mode=async&function=get_block&block_id=signup_reset_password_form&global=true last;
    
    rewrite ^/edit-profile/$    /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_simple&global=true&action=change_profile last;
    rewrite ^/change-password/$ /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_simple&global=true&action=change_pass last;
    rewrite ^/change-email/$    /index.php?mode=async&function=get_block&block_id=member_profile_edit_edit_profile_forms_simple&global=true&action=change_email last;
    rewrite ^/delete-profile/$  /index.php?mode=async&function=get_block&block_id=member_profile_delete_delete_profile_form&global=true last;
    
    rewrite ^/feedback/$        /index.php?mode=async&function=get_block&block_id=feedback_feedback_form&global=true last;
    rewrite ^/captcha/([^/]*)/$ /index.php?mode=async&function=show_security_code&captcha_id=$1 last;
    
    # SYSTEM / DO NOT CHANGE -----------------------------------------------------------------------------------------------
    rewrite ^/sitemap.xml$ /sitemap.php last;
    rewrite ^/embed/(.+)$ /player/iframe_embed.php?video_id=$1 last;
    rewrite ^/related_videos_html/([0-9]+)/?$ /related_videos_html.php?video_id=$1 last;
    rewrite ^/get_file/([0-9]+)/([^/]*)/(.*)$ /get_file.php?sg_id=$1&hash=$2&file=$3 last;
    rewrite ^/get_image/([0-9]+)/([^/]*)/(.*)/$ /get_image.php?sg_id=$1&hash=$2&file=$3 last;
    # END SYSTEM -----------------------------------------------------------------------------------------------------------
Working...
X