forked from sandeepshetty/prj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
37 lines (24 loc) · 906 Bytes
/
.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
DirectoryIndex index.php
# Deny directory listings
Options -Indexes
# Follow symbolic links
Options +FollowSymLinks
# Disable Content Negotiation to stop `RewriteCond %{REQUEST_FILENAME} !-f` from matching .php files
# /post will match /post.php if this is enabled
Options -Multiviews
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [L]
# If REQUEST_URI has more than one slash (i.e., this .htaccess is in a subdirectory)
# and if the substring of REQUEST_URI starting at the 2nd path segment is the same as the URL-path being matched
# then set an env var BASE to the first segment of REQUEST_URI
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule .* %{ENV:BASE}/index.php [L]
</IfModule>
# Protect .htaccess
<Files .htaccess>
order deny,allow
deny from all
</Files>