-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
59 lines (42 loc) · 1.3 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
#package: Centraleffects Framework
#Author: Rex Bengil
#Website: Centraleffects.com
#Company: Centraleffects BPO
#Version: 1.0
# disable directory browsing -IMPORTANT, do NOT remove.
Options -Indexes
# protect the htaccess file
<files .htaccess>
order allow,deny
deny from all
</files>
# disable the server signature
ServerSignature Off
# protect php.ini
<files *.ini>
order allow,deny
deny from all
</files>
#Disallow direct access to PHP Files
<FilesMatch "\.php$">
Order Allow,Deny
Deny from all
</FilesMatch>
<FilesMatch "index?\.php$">
Order Allow,Deny
Allow from all
</FilesMatch>
<ifmodule mod_rewrite.c>
RewriteEngine on
RewriteBase /demeter/
RewriteRule ^([a-zA-Z0-9\-]+)\/([a-zA-Z0-9\-]+)\/$ /demeter/index.php?page=$1&subpage=$2 [L]
RewriteRule ^([a-zA-Z0-9\-]+)\/([a-zA-Z0-9\-]+)\/([a-zA-Z0-9\-\/]+)\/$ /demeter/index.php?page=$1&subpage=$2&uri=$3 [L]
RewriteRule ^([a-zA-Z0-9\-]+)\/$ /demeter/index.php?page=$1 [L]
# RewriteCond %{HTTP_REFERER} !^$
# RewriteCond %{HTTP_REFERER} !^http://localhost/demeter/.*$ [NC]
# RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ - [F]
#force add slash at then end of url
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ /demeter/$1/ [L,R=301]
</ifmodule>