forked from thecodingmachine/mouf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.htaccess
33 lines (27 loc) · 1.67 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
<IfModule mod_rewrite.c>
RewriteEngine On
# .htaccess RewriteBase related tips courtesy of Symfony 2's skeleton app.
# Determine the RewriteBase automatically and set it as environment variable.
# If you are using Apache aliases to do mass virtual hosting or installed the
# project in a subdirectory, the base path will be prepended to allow proper
# resolution of the base directory and to redirect to the correct URI. It will
# work in environments without path prefix as well, providing a safe, one-size
# fits all solution. But as you do not need it in this case, you can comment
# the following 2 lines to eliminate the overhead.
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
RewriteRule doc\/view\/ %{ENV:BASE}/src/mouf_router.php
# If the requested filename exists, and has an allowed extension, simply serve it.
# We only want to let Apache serve files and not directories.
#RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .*((\.(js|ico|gif|jpg|png|css)$)|^vendor|^src/direct/|^src/mouf_router.php) - [L]
# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/src/mouf_router.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
# Use an error page as index file. It makes sure a proper error is displayed if
# mod_rewrite is not available. Additionally, this reduces the matching process for the
# start page (path "/") because otherwise Apache will apply the rewriting rules
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
DirectoryIndex vendor/mouf/mvc.splash/src/rewrite_missing.php
</IfModule>