diff options
Diffstat (limited to '.ht-nginx')
-rw-r--r-- | .ht-nginx | 25 |
1 files changed, 9 insertions, 16 deletions
@@ -4,7 +4,8 @@ # # # This file contains the configuration from the Apaches .htaccess file written # # for the nginx high performance web server. Put the content of this file into # -# the "server {}" block of your nginx virtual host configuration file. # +# the "server {}" block of your nginx virtual host configuration file. If your # +# blog installation is within a sub directory, you need to adjust this values! # # # #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%# @@ -17,21 +18,13 @@ error_page 404 /system/404.php; #=============================================================================== # Forbidden directories #=============================================================================== -location ~ ^/core|template/(.*)/(html|lang)/ { - return 403; +location ~ ^/(core|template/([^/]+)/(html|lang)/) { + return 403; } -#=========================================================================== +#=============================================================================== # Main rules -#=========================================================================== -rewrite ^/(page|post|user)/([^/]+)/$ /system/$1/main.php?param=$2 break; -rewrite ^/(page|post|user)/$ /system/$1/list.php break; -rewrite ^/feed/(page|post)/$ /system/feed/main.php?item=$1 break; -rewrite ^/(feed|search)/$ /system/$1/main.php break; - -#=========================================================================== -# Trailing slashes -#=========================================================================== -rewrite ^/(page|post|user)/([^/]+)$ /$1/$2/ redirect; -rewrite ^/(page|post|user|feed|search)$ /$1/ redirect; -rewrite ^/feed/(post|page)$ /feed/$1/ redirect;
\ No newline at end of file +#=============================================================================== +if (!-e $request_filename) { + rewrite ^(.*)$ /index.php break; +}
\ No newline at end of file |