-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
80 lines (70 loc) · 3.7 KB
/
.htaccess
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<IfModule mod_expires.c>
# Enable image client-side cache
# (Your webserver may not support these directives)
#
ExpiresActive On
ExpiresByType image/gif "access plus 2 days"
ExpiresByType image/jpeg "access plus 2 days"
ExpiresByType image/png "access plus 2 days"
</IfModule>
DirectoryIndex forum.php
<IfModule mod_rewrite.c>
# Enable short URLs
# (You need mod_rewrite for this, see FAQ section in the documentation)
#
RewriteEngine On
# You may need to set your board's URL path here.
# (See http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html#rewritebase )
#
#RewriteBase /
#ANDI use custom script for redirects - no session, no nothing
RewriteCond %{QUERY_STRING} (.*(?:^|&))req=derefer((?:&|$).*)
RewriteRule forum.php deref.php [L,QSA]
# OLD declarations
RewriteRule ^0(;(.*))?$ forum.php?rewrite=$2 [L,QSA]
RewriteRule ^([0-9]+)(;(.*))?$ forum.php?req=thread&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^([0-9]+),(-?[0-9]+)(;(.*))?$ forum.php?req=thread&id=$1&page=$2&rewrite=$4 [L,QSA]
RewriteRule ^f\.([0-9]+)(;(.*))?$ forum.php?req=main&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^t\.([0-9]+)(;(.*))?$ forum.php?req=thread&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^p\.([0-9]+)(;(.*))?$ forum.php?req=thread&postid=$1&rewrite=$3 [L,QSA]
RewriteRule ^u\.([0-9]+)(;(.*))?$ forum.php?req=cp&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^s\.(.*) forum.php?req=search&InSubject=1&InMessage=1&Query=$1 [L,QSA]
# End OLD declarations
RewriteRule ^forum/([0-9]+)[^;]*(;(.*))?$ forum.php?req=main&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^thread/([0-9]+),(-?[0-9]+)[^;/]*(;(.*))?$ forum.php?req=thread&id=$1&page=$2&rewrite=$4 [L,QSA]
RewriteRule ^thread/([0-9]+)[^;/]*(;(.*))?$ forum.php?req=thread&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^post/([0-9]+)[^;]*(;(.*))?$ forum.php?req=thread&postid=$1&rewrite=$3 [L,QSA]
RewriteRule ^user/([0-9]+)[^;]*(;(.*))?$ forum.php?req=cp&id=$1&rewrite=$3 [L,QSA]
RewriteRule ^search/(.*) forum.php?req=search&InSubject=1&InMessage=1&Query=$1 [L,QSA]
RewriteRule ^unread(;(.*))?$ forum.php?req=search&nodef=1&Special=unread&ResultView=1&rewrite=$2 [L,QSA]
RewriteRule ^new(;(.*))?$ forum.php?req=search&nodef=1&Special=new&ResultView=1&rewrite=$2 [L,QSA]
RewriteRule ^mytopics(;(.*))?$ forum.php?req=search&nodef=1&Special=mytopics&ResultView=1&rewrite=$2 [L,QSA]
RewriteRule ^cp(;(.*))?$ forum.php?req=cp&item=1&rewrite=$2 [L,QSA]
RewriteRule ^users(;(.*))?$ forum.php?req=users&rewrite=$2 [L,QSA]
RewriteRule ^search(;(.*))?$ forum.php?req=search&rewrite=$2 [L,QSA]
RewriteRule ^stat(;(.*))?$ forum.php?req=stat&rewrite=$2 [L,QSA]
RewriteRule ^forum(;(.*))?$ forum.php?req=main&rewrite=$2 [L,QSA]
# Add custom short URLs here:
#RewriteRule ^custompage(;(.*))?$ forum.php?req=custompage&rewrite=$2 [L,QSA]
# Recognise mod_rewrite presence for the installer
#
RewriteCond %{REQUEST_METHOD} ^GET$
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^install.php$ install.php?mod_rewrite=1 [QSA]
# Potential problem solution:
# If your Apache webserver has the "MultiViews" option enabled, it will not process these
# rewriting rules properly so you won't be able to visit some pages using short URLs.
# To solve this problem, you can either disable the MultiViews option or rename the file
# forum.php and all references to it (in this file and in in board.conf.php). Uncomment
# the following line to go the MultiViews way first:
#
#Options -MultiViews
#
# If this leads to an internal server error (500), undo this change and go for the other
# solution. Finally you can disable short URLs (not recommended though).
</IfModule>
# Don't allow access to the config file
<Files board.conf.*>
Order allow,deny
Deny from all
</Files>