-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspcodex.conf
37 lines (26 loc) · 1.08 KB
/
spcodex.conf
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
<VirtualHost *:80>
DocumentRoot /var/www/
ServerName spcodex.wiki
SetEnvIfNoCase User-Agent "(Yandex)" bad_bot=yes
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
AllowEncodedSlashes NoDecode
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
Deny from env=bad_bot
</Directory>
RewriteEngine On
RewriteCond %{SERVER_NAME} =spcodex.wiki
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
ErrorDocument 403 "Either this page is not accessible, or your access to SPCodex has been blocked due to apparent abuse or disruptive automation. For inquiries, please contact [email protected]"
# Redirect legacy /wiki/ route
RewriteRule "^/wiki(/.+)?$" "$1" [R,L]
# UrlShortener
RewriteRule ^r/(.*)$ /Special:UrlRedirector/$1 [PT]
RewriteCond %{REQUEST_URI} !^/rest\.php
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]
</VirtualHost>