Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index index.php index.html index.htm;
- autoindex off;
- charset utf-8;
- error_page 404 502 = /404error.php;
- if ($uri !~ "(.[a-zA-Z0-9]{1,5}|/)$") {
- rewrite /(.*)([^/])$ http://$http_host/$1$2/ permanent;
- }
- if ($http_host !~ "^www.") {
- rewrite /.* http://www.$http_host$uri permanent;
- }
- location / {
- if (!-e $request_filename){
- ## Re-directing Begin
- # Story and Category URLs
- rewrite ^/(all)/([^/]+)/?$ /story.php?title=$2 last;
- rewrite ^/(all)/?$ index.php last;
- # /recent redirection
- rewrite ^/upcoming/recent/?$ /upcoming permanent;
- rewrite ^/upcoming/recent/category/([^/]+)/?$ /upcoming/category/$1 permanent;
- rewrite ^/upcoming/recent/page/(\d+)/?$ /upcoming/page/$1 permanent;
- rewrite ^/upcoming/recent/category/([^/]+)/page/(\d+)/?$ /upcoming/category/$1/page/$2 permanent;
- rewrite ^/recent/?$ /./ permanent;
- rewrite ^/recent/category/([^/]+)/?$ /category/$1 permanent;
- rewrite ^/recent/page/(\d+)/?$ /page/$1 permanent;
- rewrite ^/recent/category/([^/]+)/page/(\d+)/?$ /category/$1/page/$2 permanent;
- rewrite ^/upcoming/recent/([^/]+)/?$ /upcoming/category/$1 permanent;
- rewrite ^/upcoming/recent/([^/]+)/page/(\d+)/?$ /upcoming/category/$1/page/$2 permanent;
- rewrite ^/recent/([^/]+)/?$ /category/$1 permanent;
- rewrite ^/recent/([^/]+)/page/(\d+)/?$ /category/$1/page/$2 permanent;
- rewrite ^/upcoming/([^/]+)/rss/?$ /rss.php?status=queued&category=$1 last;
- rewrite ^/upcoming/rss/?$ /rss.php?status=queued last;
- rewrite ^/(\d+)/rss/?$ /storyrss.php?id=$1 last;
- rewrite ^/([^/]+)/rss/?$ /rss.php?category=$1 last;
- rewrite ^/user/profile/([^/]+)/rss/?$ /userrss.php?user=$1 last;
- rewrite ^/user/profile/([^/]+)/rss/([a-zA-Z0-9-]+)/?$ /userrss.php?user=$1&status=$2 last;
- rewrite ^/rss/?$ /rss.php last;
- rewrite ^/search/([^/]+)/rss/?$ /rss.php?search=$1 last;
- rewrite ^/group/([^/]+)/rss/?$ /rss.php?status=published&group=$1 last;
- rewrite ^/group/([^/]+)/upcoming/rss/?$ /rss.php?status=queued&group=$1 last;
- rewrite ^/group/([^/]+)/shared/rss/?$ /rss.php?status=shared&group=$1 last;
- rewrite ^/([^/]+)/([^/]+)/rss/?$ /storyrss.php?title=$2 last;
- rewrite ^/rss/([a-zA-Z0-9-]+)/?$ /rss.php?status=$1 last;
- rewrite ^/rss/category/([^/]+)/?$ /rss.php?category=$1 last;
- rewrite ^/rss/category/upcoming/([^/]+)/?$ /rss.php?status=queued&category=$1 last;
- rewrite ^/rss/category/published/([^/]+)/?$ /rss.php?status=published&category=$1 last;
- rewrite ^/rss/category/([^/]+)/queued/?$ /rss.php?status=queued&category=$1 last;
- rewrite ^/rss/category/([^/]+)/published/?$ /rss.php?status=published&category=$1 last;
- rewrite ^/rss/category/([^/]+)/group/([^/]+)/?$ /rss.php?category=$1&group=$2 last;
- rewrite ^/rss/category/upcoming/([^/]+)/([^/]+)/?$ /rss.php?status=queued&category=$1&group=$2 last;
- rewrite ^/rss/category/published/([^/]+)/([^/]+)/?$ /rss.php?status=published&category=$1&group=$2 last;
- rewrite ^/rss/search/([^/]+)/?$ /rss.php?search=$1 last;
- rewrite ^/rssfeeds/?$ /rssfeeds.php last;
- ## URL Method 2 Begin ##
- rewrite ^/?$ /index.php last;
- rewrite ^/advanced-search/?$ /advancedsearch.php last;
- rewrite ^/category/([^/]+)/?$ /index.php?category=$1 last;
- rewrite ^/category/([^/]+)/([^/]+)/?$ story.php?title=$2 last;
- rewrite ^/new/?$ /new.php last;
- rewrite ^/new/recent/?$ /new permanent;
- rewrite ^/new/recent/category/([^/]+)/?$ /new/category/$1 permanent;
- rewrite ^/new/recent/page/(d+)/?$ /new/page/$1 permanent;
- rewrite ^/new/recent/category/([^/]+)/page/(d+)/?$ /new/category/$1/page/$2 permanent;
- rewrite ^/new/recent/([^/]+)/?$ /new/category/$1 permanent;
- rewrite ^/new/recent/([^/]+)/page/(d+)/?$ /new/category/$1/page/$2 permanent;
- rewrite ^/new/([^/]+)/rss/?$ /rss.php?status=new&category=$1 last;
- rewrite ^/new/rss/?$ /rss.php?status=new last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/?$ /new.php?part=$1 last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/?$ /new.php?part=$1&category=$2 last;
- rewrite ^/new/([^/]+)/?$ /new.php?category=$1 last;
- rewrite ^/new/page/([0-9]+)/?$ /new.php?page=$1 last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/page/(d+)/?$ /new.php?part=$1&page=$2 last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/page/(d+)/?$ /new.php?part=$1&category=$2&page=$3 last;
- rewrite ^/user/([^/]+)/profile/?$ /user/$1/ permanent;
- rewrite ^/user/([^/]+)/edit/?$ /profile.php?login=$1 last;
- rewrite ^/live/new/?$ /live_unpublished.php last;
- rewrite ^/live/new/page/([^/]+)/?$ /live_unpublished.php?page=$1 last;
- rewrite ^/new/([^/]+)/page/(d+)/?$ /new.php?category=$1&page=$2 last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/?$ /new.php?part=$1&category=$2 last;
- rewrite ^/new/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/page/(d+)/?$ /new.php?part=$1&category=$2&page=$3 last;
- rewrite ^/login/?$ /login.php last;
- rewrite ^/login/([a-zA-Z0-9-]+)/?$ /login.php?return=$1 last;
- rewrite ^/login/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ /login.php?return=$1/$2 last;
- rewrite ^/logout/?$ /login.php?op=logout&return=index.php last;
- rewrite ^/logout/([a-zA-Z0-9-]+)/([a-zA-Z0-9-]+)/?$ /login.php?op=logout&return=$1/$2 last;
- rewrite ^/out/([\d]+)/?$ /out.php?id=$1 last;
- rewrite ^/out/(https?:.+)$ /out.php?url=$1 last;
- rewrite ^/out/([^/]+)/?$ /out.php?title=$1 last;
- rewrite ^/profile/?$ /profile.php last;
- rewrite ^/register/?$ /register.php last;
- rewrite ^/search/([^/]+)/page/(\d+)/?$ /search.php?search=$1&page=$2 last;
- rewrite ^/search/(.+)/?$ /search.php?search=$1 last;
- rewrite ^/searchurl/(.+)/?$ /search.php?url=$1 last;
- rewrite ^/settemplate/?$ /settemplate.php last;
- rewrite ^/story/([0-9]+)/?$ /story.php?id=$1 last;
- rewrite ^/story/([^/]+)/?$ /story.php?title=$1 last;
- rewrite ^/story/([0-9]+)/editcomment/([0-9]+)/?$ /edit.php?id=$1&commentid=$2 last;
- rewrite ^/story/([0-9]+)/edit/?$ /editlink.php?id=$1 last;
- rewrite ^/submit/?$ /submit.php last;
- rewrite ^/tag/([^/]+)/([^/]+)/?$ /search.php?search=$1&tag=true&from=$2 last;
- rewrite ^/tag/([^/]+)/?$ /search.php?search=$1&tag=true last;
- rewrite ^/tag/([^/]+)/page/(.+)/?$ /search.php?search=$1&tag=true&page=$2 last;
- rewrite ^/tagcloud/?$ /cloud.php last;
- rewrite ^/tagcloud/range/([0-9]+)/?$ /cloud.php?range=$1 last;
- rewrite ^/topusers/?$ /topusers.php last;
- rewrite ^/trackback/([0-9]+)/?$ /trackback.php?id=$1 last;
- rewrite ^/upcoming/?$ /upcoming.php last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/?$ /upcoming.php?part=$1 last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/?$ /upcoming.php?part=$1&category=$2 last;
- rewrite ^/upcoming/([^/]+)/?$ /upcoming.php?category=$1 last;
- rewrite ^/upcoming/page/([0-9]+)/?$ /upcoming.php?page=$1 last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/page/(\d+)/?$ /upcoming.php?part=$1&page=$2 last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/page/(\d+)/?$ /upcoming.php?part=$1&category=$2&page=$3 last;
- rewrite ^/user/?$ /user.php last;
- rewrite ^/user/search/([^/]+)/?$ /user.php?view=search&keyword=$1 last;
- rewrite ^/user/profile/([^/]+)/following/?$ /user.php?login=$1&view=following last;
- rewrite ^/user/profile/([^/]+)/followers/?$ /user.php?login=$1&view=followers last;
- rewrite ^/user/([^/]+)/?$ /user.php?view=$1 last;
- rewrite ^/user/([^/]+)/([^/]+)/?$ /user.php?view=$1&login=$2 last;
- rewrite ^/user/([^/]+)/link/([0-9+]+)/?$ /user_add_remove_links.php?action=$1&link=$2 last;
- ## Admin
- rewrite ^/admin/?$ /admin/admin_index.php last;
- rewrite ^/admin_comments/page/([^/]+)/?$ /admin/admin_comments.php?page=$1 last;
- rewrite ^/admin_links/page/([^/]+)/?$ /admin/admin_links.php?page=$1 last;
- rewrite ^/admin_users/page/([^/]+)/?$ /admin/admin_users.php?page=$1 last;
- rewrite ^/story/([0-9]+)/modify/([a-z]+)/?$ /admin/linkadmin.php?id=$1&action=$2 last;
- rewrite ^/view/([^/]+)/?$ /admin/admin_users.php?mode=view&user=$1 last;
- ## Groups
- rewrite ^/join_group/action/(published|queued|discard)/link/(\d+)/?$ /join_group.php?action=$1&link=$2 last;
- rewrite ^/groups/?$ /groups.php last;
- rewrite ^/groups/search/([^/]+)/?$ /groups.php?view=search&keyword=$1 last;
- rewrite ^/groups/submit/?$ /submit_groups.php last;
- rewrite ^/groups/(members|name|oldest|newest)/?$ /groups.php?sortby=$1 last;
- rewrite ^/groups/([^/]+)/?$ /group_story.php?title=$1 last;
- rewrite ^/groups/([^/]+)/page/([0-9]+)/?$ /group_story.php?title=$1&page=$2 last;
- rewrite ^/groups/([^/]+)/?$ /group_story.php?title=$1&view=published last;
- rewrite ^/groups/([^/]+)/(published|upcoming|shared|members)/?$ /group_story.php?title=$1&view=$2 last;
- rewrite ^/groups/([^/]+)/(published|upcoming|shared|members)/page/([0-9]+)/?$ /group_story.php?title=$1&view=$2&page=$3 last;
- rewrite ^/groups/([^/]+)/(published|upcoming|shared|members)/category/([^/]+)/?$ /group_story.php?title=$1&view=$2&category=$3 last;
- rewrite ^/groups/([^/]+)/(published|upcoming|shared|members)/category/([^/]+)/page/([0-9]+)?$ /group_story.php?title=$1&view=$2&category=$3&page=$4 last;
- rewrite ^/groups/delete/([0-9]+)/?$ /deletegroup.php?id=$1 last;
- rewrite ^/groups/edit/([0-9]+)/?$ /editgroup.php?id=$1 last;
- rewrite ^/groups/id/([0-9]+)/?$ /group_story.php?id=$1 last;
- rewrite ^/groups/join/([0-9]+)/? /join_group.php?id=$1&join=true last;
- rewrite ^/groups/member/admin/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ /groupadmin.php?id=$1&role=admin&userid=$3 last;
- rewrite ^/groups/member/normal/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ /groupadmin.php?id=$1&role=normal&userid=$3 last;
- rewrite ^/groups/member/moderator/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ /groupadmin.php?id=$1&role=$2&userid=$3 last;
- rewrite ^/groups/member/flagged/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ /groupadmin.php?id=$1&role=flagged&userid=$3 last;
- rewrite ^/groups/member/banned/id/([0-9]+)/role/([a-zA-Z0-9_-]+)/userid/([0-9]+)/?$ /groupadmin.php?id=$1&role=banned&userid=$3 last;
- rewrite ^/groups/page/([0-9]+)/?$ /groups.php?page=$1 last;
- rewrite ^/groups/unjoin/([0-9]+)/? /join_group.php?id=$1&join=false last;
- rewrite ^/groups/withdraw/([0-9]+)/user_id/([0-9]+)/?$ /join_group.php?group_id=$1&user_id=$2&activate=withdraw last;
- ## Live
- rewrite ^/live/?$ /live.php last;
- rewrite ^/live/comments/?$ /live_comments.php last;
- rewrite ^/live/comments/page/([^/]+)/?$ /live_comments.php?page=$1 last;
- rewrite ^/live/published/?$ /live_published.php last;
- rewrite ^/live/published/page/([^/]+)/?$ /live_published.php?page=$1 last;
- rewrite ^/live/upcoming/?$ /live_unpublished.php last;
- rewrite ^/live/upcoming/page/([^/]+)/?$ /live_unpublished.php?page=$1 last;
- #Modules
- rewrite ^/inbox/?$ /module.php?module=simple_messaging&view=inbox last;
- rewrite ^/sitemapindex.xml /module.php?module=xml_sitemaps_show_sitemap last;
- rewrite ^/sitemap-([a-zA-Z0-9]+).xml /module.php?module=xml_sitemaps_show_sitemap&i=$1 last;
- rewrite ^/status/([0-9]+)/?$ /modules/status/status.php?id=$1 last;
- rewrite ^/toolbar/(\d+)/?$ /modules/pligg_web_toolbar/toolbar.php?id=$1;
- rewrite ^/sitemapindex.xml /module.php?module=xml_sitemaps_show_sitemap last;
- rewrite ^/sitemap-([0-9a-z]+).xml /module.php?module=xml_sitemaps_show_sitemap&i=$1 last;
- ## Pages
- rewrite ^/about/?$ /page.php?page=about last;
- rewrite ^/static/([^/]+)/?$ /page.php?page=$1 last;
- ## Pagination
- rewrite ^/category/([^/]+)/page/([^/]+)/?$ /index.php?category=$1&page=$2 last;
- rewrite ^/page/([^/]+)/?$ /index.php?page=$1 last;
- rewrite ^/page/([^/]+)/([^/]+)category/([^/]+)/?$ /index.php?page=$1&part=$2&category=$3 last;
- rewrite ^/upcoming/([^/]+)/page/(\d+)/?$ /upcoming.php?category=$1&page=$2 last;
- rewrite ^/published/page/([^/]+)/([^/]+)/?$ /index.php?page=$1&category=$2 last;
- rewrite ^/published/page/([^/]+)/([^/]+)/([^/]+)/?$ /index.php?page=$1&part=$2&category=$3 last;
- rewrite ^/published/page/([^/]+)/?$ /index.php?page=$1 last;
- rewrite ^/published/page/([^/]+)/category/([^/]+)/?$ /index.php?page=$1&category=$2 last;
- rewrite ^/published/page/([^/]+)/([^/]+)category/([^/]+)/?$ /index.php?page=$1&part=$2&category=$3 last;
- rewrite ^/published/page/([^/]+)/([^/]+)/?$ /index.php?page=$1&part=$2 last;
- rewrite ^/published/page/([^/]+)/range/([^/]+)/?$ /?page=$1&range=$2 last;
- rewrite ^/search/page/([^/]+)/([^/]+)/?$ /search.php?page=$1&search=$2 last;
- rewrite ^/topusers/page/([^/]+)/?$ /topusers.php?page=$1 last;
- rewrite ^/topusers/page/([^/]+)/sortby/([^/]+)?$ /topusers.php?page=$1&sortby=$2 last;
- rewrite ^/user/page/([^/]+)/([^/]+)/([^/]+)/?$ /user.php?page=$1&view=$2&login=$3 last;
- rewrite ^/user/([^/]+)/([^/]+)/page/(\d+)/?$ /user.php?page=$3&view=$1&login=$2 last;
- ## Sort
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/?$ /index.php?part=$1 last;
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/?$ /index.php?part=$1&category=$2 last;
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/page/(\d+)/?$ /index.php?part=$1&page=$2 last;
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/category/([^/]+)/page/(\d+)/?$ /index.php?part=$1&category=$2&page=$3 last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/?$ /upcoming.php?part=$1&category=$2 last;
- rewrite ^/upcoming/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/page/(\d+)/?$ /upcoming.php?part=$1&category=$2&page=$3 last;
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/?$ /index.php?part=$1&category=$2 last;
- rewrite ^/(year|month|week|today|yesterday|recent|alltime|upvoted|downvoted|commented)/([^/]+)/page/(\d+)/?$ /index.php?part=$1&category=$2&page=$3 last;
- ## URL Method 2 End ##
- }
- if (!-e $request_filename){
- rewrite ^/([^/]+)/?$ /index.php?category=$1 last;
- }
- if (!-e $request_filename){
- rewrite ^/([^/]+)/page/([^/]+)/?$ /index.php?category=$1&page=$2 last;
- }
- if (!-e $request_filename){
- rewrite ^/([^/]+)/([^/]+)/?$ /story.php?title=$2&category=$1 last;
- rewrite ^/([^/]+)/([^/]+)/([0-9]+)/?$ /story.php?title=$2&category=$1&comment_id=$3 last;
- rewrite ^/([^/]+)/([^/]+)/reply/([0-9]+)/?$ /story.php?title=$2&category=$1&comment_id=$3&reply=1 last;
- }
- if ($query_string ~* 'mosConfig_[a-zA-Z_]{1,21}(=|\%3D)' ){
- return 405;
- }
- if ($query_string ~* base64_encode.*\(.*\) ){
- return 405;
- }
- if ($query_string ~* (\<|%3C).*script.*(\>|%3E) ){
- return 405;
- }
- if ($query_string ~* 'GLOBALS(=|\[|\%[0-9A-Z]{0,2})' ){
- return 405;
- }
- if ($query_string ~* '_REQUEST(=|\[|\%[0-9A-Z]{0,2})' ){
- return 405;
- }
- if ($http_user_agent ~* ^pycurl/){
- return 405;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement