forked from AKSW/OntoWiki
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
71 lines (56 loc) · 2.86 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
# OntoWiki .htaccess file
# WARNING: If you do not use the htaccess at all or your htaccess is
# ignored, then your config.ini can be loaded over the web !!!
<Files "*.ini">
Deny from all
</Files>
# OntoWiki does not requires Apache's rewrite engine to work. However,
# if you would like to have nice (Linked Data) URIs you must enable URL
# rewriting by enabling mod_rewrite in your apache config.
<IfModule mod_rewrite.c>
RewriteEngine On
# This gives ontowiki an easy hint that rewrite is enabled
<IfModule mod_env.c>
SetEnv ONTOWIKI_APACHE_MOD_REWRITE_ENABLED 1
</IfModule>
# for deployment purposes, we want to redirect to a maintenance page iff it exists
# works only if document root is ontowiki folder
#RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
#RewriteCond %{REQUEST_FILENAME} !/maintenance.html
#RewriteRule ^.*$ /maintenance.html [R=503,L]
#ErrorDocument 503 /maintenance.html
# favicon files are located under /application
RewriteRule ^favicon\.(.*)$ application/favicon.$1
# do not rewrite requests on /robots.txt or /maintenance.html
RewriteCond %{REQUEST_URI} !/(robots.txt|maintenance.html)$
# do not rewrite requests on resource under public in extensions
RewriteCond %{REQUEST_URI} !/extensions/.*/public/.*$
# do not rewrite requests on /favicon.ico and /favicon.png
RewriteCond %{REQUEST_URI} !/favicon\.(ico|png)$
# do not rewrite requests on files with the whitelisted extensions under extensions (if file exists)
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} !/extensions/.*/.*\.(js|css|gif|ico|png|jpg|svg)$
# do not rewrite requests on files with the whitelisted extensions under libraries/RDFauthor (if file exists)
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_URI} !/libraries/RDFauthor/.*/.*\.(js|css|gif|ico|png|jpg|svg)$
RewriteRule ^.*$ index.php
# Set RewriteBase if your OntoWiki virtual host is managed with VirtualDocumentRoot.
#RewriteBase /
# Set RewriteBase only if your OntoWiki folder is not located in your web server's root dir.
#RewriteBase /ontowiki
</IfModule>
# if you allow short open tags, xml templates will crash
# please refer https://github.com/AKSW/OntoWiki/wiki/php.ini-recommendations
# for recommended PHP settings
# maybe php_flag is not allowed in your environment,
# but if you allow short open tags, xml templates will crash
#php_flag short_open_tag 0
### Additional Auth with external OntoWiki auth-script
### (more infos at http://code.google.com/p/mod-auth-external/)
#AuthType Basic
#AuthName OntoWiki
#AuthBasicProvider external
#AuthExternal ontowiki
#Require valid-user
### NOTE: This is needed to be included in /etc/apache2/mods-enabled/authnz_external.load or .conf
#DefineExternalAuth ontowiki pipe /path/to/ontowiki/application/scripts/mod-auth-external/ontowiki.php