aboutsummaryrefslogtreecommitdiffstats
path: root/.htaccess
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2017-02-24 21:27:59 +0100
committerThomas Lange <code@nerdmind.de>2017-02-24 21:27:59 +0100
commit52b077a48c743ba4d08ac00520a0bf1ef6deef5f (patch)
treeb4205c194167e0e03e273957cdd0aab3be9fdf01 /.htaccess
downloadblog-52b077a48c743ba4d08ac00520a0bf1ef6deef5f.tar.gz
blog-52b077a48c743ba4d08ac00520a0bf1ef6deef5f.tar.xz
blog-52b077a48c743ba4d08ac00520a0bf1ef6deef5f.zip
Initial commit.v1.0
Diffstat (limited to '.htaccess')
-rw-r--r--.htaccess42
1 files changed, 42 insertions, 0 deletions
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..c354b0b
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,42 @@
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# Apache configuration rules [Thomas Lange <code@nerdmind.de>] #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+# #
+# This file contains rewrite rules for Apache. It's recommended to include the #
+# rules directly into your Apache configuration for a better performance. Also #
+# disable the AllowOverride directive within your Apache virtualhost (if it is #
+# not already globally disabled for performance and security reasons both). #
+# #
+#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%#
+
+#===============================================================================
+# Enable RewriteEngine and define RewriteBase
+#===============================================================================
+RewriteEngine On
+RewriteBase /
+
+#===============================================================================
+# ErrorDocument handler
+#===============================================================================
+ErrorDocument 403 /system/403.php
+ErrorDocument 404 /system/404.php
+
+#===============================================================================
+# Forbidden directories
+#===============================================================================
+RewriteRule ^core|template/(.*)/(html|lang)/ - [F]
+
+#===============================================================================
+# Main rules
+#===============================================================================
+RewriteRule ^(page|post|user)/([^/]+)/$ system/$1/main.php?param=$2 [L]
+RewriteRule ^(page|post|user)/$ system/$1/list.php [L]
+RewriteRule ^feed/(page|post)/$ system/feed/main.php?item=$1 [L]
+RewriteRule ^(feed|search)/$ system/$1/main.php [L]
+
+#===============================================================================
+# Trailing slashes
+#===============================================================================
+RewriteRule ^(page|post|user)/([^/]+)$ $1/$2/ [R,L]
+RewriteRule ^(page|post|user|feed|search)$ $1/ [R,L]
+RewriteRule ^feed/(post|page)$ feed/$1/ [R,L] \ No newline at end of file