Jump to content

Nginx rewrite rules for paysite theme


Tech Support
 Share

Recommended Posts

# global ---------------------------------------------------------------------------------------------------------------

rewrite ^/terms/$   /terms.php last;
rewrite ^/dmca/$    /dmca.php last;
rewrite ^/2257/$    /2257.php last;
rewrite ^/privacy/$ /privacy.php last;

rewrite ^/random_video(/)?$ /redirect_random_video.php last;
rewrite ^/random_album(/)?$ /redirect_random_album.php last;

rewrite ^/rss/videos/$                    /rss_videos.php last;
rewrite ^/rss/albums/$                    /rss_albums.php last;
rewrite ^/rss/tags/([^/]+)/videos/$       /rss_videos.php?tag=$1 last;
rewrite ^/rss/tags/([^/]+)/albums/$       /rss_albums.php?tag=$1 last;
rewrite ^/rss/categories/([^/]+)/videos/$ /rss_videos.php?category=$1 last;
rewrite ^/rss/categories/([^/]+)/albums/$ /rss_albums.php?category=$1 last;
rewrite ^/rss/models/([^/]+)/videos/$     /rss_videos.php?model=$1 last;
rewrite ^/rss/models/([^/]+)/albums/$     /rss_albums.php?model=$1 last;

# search ---------------------------------------------------------------------------------------------------------------

rewrite ^/search/([^/]+)/albums/([0-9]+)/$ /albums_list.php?q=$1&from=$2 last;
rewrite ^/search/([^/]+)/albums/$          /albums_list.php?q=$1 last;
rewrite ^/search/([^/]+)/models/([0-9]+)/$ /models_list.php?q=$1&from=$2 last;
rewrite ^/search/([^/]+)/models/$          /models_list.php?q=$1 last;
rewrite ^/search/([^/]+)/([0-9]+)/$        /videos_list.php?q=$1&from=$2 last;
rewrite ^/search/([^/]+)/$                 /videos_list.php?q=$1 last;
rewrite ^/search/$                         /videos_list.php last;

# videos ---------------------------------------------------------------------------------------------------------------

rewrite ^/videos/([0-9]+)/$ /videos_list.php?from=$1 last;
rewrite ^/videos/$          /videos_list.php last;

rewrite ^/videos/([0-9]+)/([^/]+)/$ /view_video.php?id=$1&dir=$2 last;
rewrite ^/videos/([^/]+)/$          /view_video.php?dir=$1 last;

# albums ---------------------------------------------------------------------------------------------------------------

rewrite ^/albums/([0-9]+)/$ /albums_list.php?from=$1 last;
rewrite ^/albums/$          /albums_list.php last;

rewrite ^/albums/([0-9]+)/([^/]+)/$ /view_album.php?id=$1&dir=$2 last;
rewrite ^/albums/([^/]+)/$          /view_album.php?dir=$1 last;

# playlists ------------------------------------------------------------------------------------------------------------

rewrite ^/playlists/([0-9]+)/([^/]+)/$ /view_playlist.php?id=$1&type=fav_videos&ipp=30&playlist_id=$1 last;

# tags ---------------------------------------------------------------------------------------------------------------

rewrite ^/tags/([^/]+)/([0-9]+)/$        /content_list.php?tag=$1&from=$2 last;
rewrite ^/tags/([^/]+)/$                 /content_list.php?tag=$1 last;
rewrite ^/tags/([^/]+)/videos/([0-9]+)/$ /videos_list.php?tag=$1&from=$2 last;
rewrite ^/tags/([^/]+)/videos/$          /videos_list.php?tag=$1 last;
rewrite ^/tags/([^/]+)/albums/([0-9]+)/$ /albums_list.php?tag=$1&from=$2 last;
rewrite ^/tags/([^/]+)/albums/$          /albums_list.php?tag=$1 last;

# categories  ----------------------------------------------------------------------------------------------------------

rewrite ^/categories/([0-9]+)/$ /categories_list.php?from=$1 last;
rewrite ^/categories/$          /categories_list.php last;

rewrite ^/categories/([^/]+)/([0-9]+)/$        /content_list.php?category=$1&from=$2 last;
rewrite ^/categories/([^/]+)/$                 /content_list.php?category=$1 last;
rewrite ^/categories/([^/]+)/videos/([0-9]+)/$ /videos_list.php?category=$1&from=$2 last;
rewrite ^/categories/([^/]+)/videos/$          /videos_list.php?category=$1 last;
rewrite ^/categories/([^/]+)/albums/([0-9]+)/$ /albums_list.php?category=$1&from=$2 last;
rewrite ^/categories/([^/]+)/albums/$          /albums_list.php?category=$1 last;

# models  --------------------------------------------------------------------------------------------------------------

rewrite ^/models/([0-9]+)/$        /models_list.php?from=$1 last;
rewrite ^/models/$                 /models_list.php last;
rewrite ^/models/([^/])/([0-9]+)/$ /models_list.php?section=$1&from=$2 last;
rewrite ^/models/([^/])/$          /models_list.php?section=$1 last;

rewrite ^/models/([^/]+)/([0-9]+)/$        /content_list.php?model=$1&from=$2 last;
rewrite ^/models/([^/]+)/$                 /content_list.php?model=$1 last;
rewrite ^/models/([^/]+)/videos/([0-9]+)/$ /videos_list.php?model=$1&from=$2 last;
rewrite ^/models/([^/]+)/videos/$          /videos_list.php?model=$1 last;
rewrite ^/models/([^/]+)/albums/([0-9]+)/$ /albums_list.php?model=$1&from=$2 last;
rewrite ^/models/([^/]+)/albums/$          /albums_list.php?model=$1 last;

# memberzone -----------------------------------------------------------------------------------------------------------

rewrite ^/my/$                             /member_profile_view.php last;
rewrite ^/my/favourites/videos/([0-9]+)/$  /member_profile_view.php?type=fav_videos&from_my_fav_videos=$1 last;
rewrite ^/my/favourites/videos/$           /member_profile_view.php?type=fav_videos last;
rewrite ^/my/favourites/albums/([0-9]+)/$  /member_profile_view.php?type=fav_albums&from_my_fav_albums=$1 last;
rewrite ^/my/favourites/albums/$           /member_profile_view.php?type=fav_albums last;
rewrite ^/my/favourites/models/([0-9]+)/$  /member_profile_view.php?type=fav_models&from_my_fav_models=$1 last;
rewrite ^/my/favourites/models/$           /member_profile_view.php?type=fav_models last;
rewrite ^/my/playlist/([0-9]+)/([0-9]+)/$  /member_profile_view.php?type=fav_videos&playlist_id=$1&from_my_fav_videos=$1 last;
rewrite ^/my/playlist/([0-9]+)/$           /member_profile_view.php?type=fav_videos&playlist_id=$1 last;
rewrite ^/my/playlists/([0-9]+)/$          /member_profile_view.php?type=playlists&from_my_playlists=$1 last;
rewrite ^/my/playlists/$                   /member_profile_view.php?type=playlists last;

rewrite ^/my/playlist/view/([0-9]+)/([0-9]+)/$ /view_video.php?playlist=$1&id=$2 last;

rewrite ^/my/playlists/new/$           /index.php?mode=async&function=get_block&block_id=playlist_edit_edit_playlist_form&global=true last;
rewrite ^/my/playlists/select/$        /index.php?mode=async&function=get_block&block_id=list_playlists_playlists_selector&global=true last;
rewrite ^/my/playlists/edit/([0-9]+)/$ /index.php?mode=async&function=get_block&block_id=playlist_edit_edit_playlist_form&global=true&playlist_id=$1 last;

rewrite ^/logout/$   /logout.php last;
rewrite ^/email/$    /email_links.php last;
rewrite ^/payments/$ /payment_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=signup_signup_form_premium&global=true&error=only_for_members last;
rewrite ^/signup/$           /index.php?mode=async&function=get_block&block_id=signup_signup_form_premium&global=true last;
rewrite ^/upgrade/$          /index.php?mode=async&function=get_block&block_id=upgrade_upgrade_access&global=true last;
rewrite ^/upgrade-required/$ /index.php?mode=async&function=get_block&block_id=upgrade_upgrade_access&global=true&error=only_for_members last;
rewrite ^/reset-password/$   /index.php?mode=async&function=get_block&block_id=signup_reset_password_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 -----------------------------------------------------------------------------------------------------------

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...