aboutsummaryrefslogtreecommitdiffstats
path: root/.htaccess
blob: c354b0bb1c178a52416bf7a692e2c1db24330aa8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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]