-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.htaccess
27 lines (24 loc) · 910 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
ErrorDocument 403 "Error 403"
ErrorDocument 404 "Error 404"
ErrorDocument 500 "Error 500"
# Rewrite path to query string
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Juist ae item alloued in path efter /q/ (https://httpd.apache.org/docs/trunk/rewrite/remapping.html#rewrite-query)
RewriteRule ^/?q/([^/]+)$ /index.php?q=$1
RewriteRule ^/?dev/q/([^/]+)$ /dev/index.php?q=$1 [L]
# Hide .php from file extension in browser
RewriteEngine On
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [NC,L]
# gzip
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>