aboutsummaryrefslogtreecommitdiffstats
path: root/.ht-nginx
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-03-10 21:46:12 +0100
committerThomas Lange <code@nerdmind.de>2017-03-10 21:46:12 +0100
commite33c245d910e55b8cab407a03e669470509a705d (patch)
treee958504564ab47e72e0d3dcfe0b967440007b1d9 /.ht-nginx
parentaae885b9784466ab412e4010893808867e93c213 (diff)
downloadblog-e33c245d910e55b8cab407a03e669470509a705d.tar.gz
blog-e33c245d910e55b8cab407a03e669470509a705d.tar.xz
blog-e33c245d910e55b8cab407a03e669470509a705d.zip
Several changes have been made in this commit, which together with the previous commits result in version 1.1:v1.1
+ The rules for the Apache and nginx configuration have been changed and redirects now all requests to the index.php. + A router class has been added which now handles all requests that arrives at the application on the index.php. + Short-hand functions "PAGE", "POST" and "USER" for use in templates added to get specific item data by ID. + More language variables have been added to the core language.
Diffstat (limited to '.ht-nginx')
-rw-r--r--.ht-nginx25
1 files changed, 9 insertions, 16 deletions
diff --git a/.ht-nginx b/.ht-nginx
index 814bea9..9d3053f 100644
--- a/.ht-nginx
+++ b/.ht-nginx
@@ -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