2015-06-26 17:07:12 +03:00
|
|
|
RewriteEngine on
|
|
|
|
|
RewriteBase /
|
|
|
|
|
|
2015-07-08 00:06:25 +03:00
|
|
|
## Redirect other domains
|
|
|
|
|
RewriteCond %{HTTP_HOST} !^mehl\.mx$
|
2015-06-26 17:07:12 +03:00
|
|
|
RewriteRule ^(.*)$ http://mehl.mx/$1 [L,R=301]
|
|
|
|
|
|
|
|
|
|
## Nice URLs
|
|
|
|
|
# Rewrite URL/de to URL/index.de.php
|
|
|
|
|
RewriteRule ^(..)/?$ /index.$1.php
|
2015-06-26 17:30:28 +03:00
|
|
|
# Rewrite e.g. URL/en/contact to URL/contact.en.php
|
2015-06-26 17:54:14 +03:00
|
|
|
RewriteRule ^(..)/([A-Za-z]+)/?$ /$2.$1.php
|
2015-06-26 17:07:12 +03:00
|
|
|
# Rewrite empty URL to standard index page
|
2015-06-26 17:46:16 +03:00
|
|
|
RewriteRule ^/?$ index.de.php
|
2015-06-26 17:30:28 +03:00
|
|
|
# Rewrite e.g. URL/contact to URL/de/contact and make it visible
|
2015-06-26 17:54:14 +03:00
|
|
|
RewriteRule ^([A-Za-z]+)/?$ /de/$1 [R=301,L]
|
2015-06-26 17:07:12 +03:00
|
|
|
|
|
|
|
|
## Error Documents
|
|
|
|
|
ErrorDocument 403 /404.php
|
|
|
|
|
ErrorDocument 404 /404.php
|
|
|
|
|
|
|
|
|
|
# Old redirections
|
|
|
|
|
Redirect 301 /blog http://blog.max-mehl.com/
|
|
|
|
|
Redirect 301 /it-services http://it.mehl.mx
|
|
|
|
|
|
2017-05-15 00:45:24 +02:00
|
|
|
# Forbid .git folder
|
|
|
|
|
RedirectMatch 404 /\.git
|
2015-06-26 17:07:12 +03:00
|
|
|
|
|
|
|
|
## SSL
|
2015-07-11 20:16:23 +03:00
|
|
|
# Enforce SSL
|
2015-06-26 17:07:12 +03:00
|
|
|
# RewriteCond %{SERVER_PORT} !^443$
|
|
|
|
|
# RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Compression
|
2015-07-07 18:06:02 +03:00
|
|
|
AddOutputFilterByType DEFLATE text/plain
|
|
|
|
|
AddOutputFilterByType DEFLATE text/html
|
|
|
|
|
AddOutputFilterByType DEFLATE text/xml
|
|
|
|
|
AddOutputFilterByType DEFLATE text/css
|
|
|
|
|
AddOutputFilterByType DEFLATE text/javascript
|
|
|
|
|
AddOutputFilterByType DEFLATE application/xml
|
|
|
|
|
AddOutputFilterByType DEFLATE application/xhtml+xml
|
|
|
|
|
AddOutputFilterByType DEFLATE application/rss+xml
|
|
|
|
|
AddOutputFilterByType DEFLATE application/javascript
|
|
|
|
|
AddOutputFilterByType DEFLATE application/x-javascript
|
2015-06-26 17:07:12 +03:00
|
|
|
|
|
|
|
|
# Caching
|
|
|
|
|
<ifModule mod_expires.c>
|
2015-07-07 18:06:02 +03:00
|
|
|
# A = access <seconds>
|
|
|
|
|
ExpiresActive On
|
|
|
|
|
ExpiresByType text/html A300
|
|
|
|
|
ExpiresByType text/plain A300
|
|
|
|
|
ExpiresDefault A604800
|
|
|
|
|
|
|
|
|
|
ExpiresByType text/javascript A604800
|
|
|
|
|
ExpiresByType application/javascript A604800
|
|
|
|
|
ExpiresByType application/x-javascript A604800
|
|
|
|
|
ExpiresByType text/css A604800
|
|
|
|
|
ExpiresByType image/gif A604800
|
|
|
|
|
ExpiresByType image/png A604800
|
|
|
|
|
ExpiresByType image/jpeg A604800
|
|
|
|
|
ExpiresByType application/x-shockwave-flash A604800
|
|
|
|
|
ExpiresByType video/x-flv A604800
|
|
|
|
|
ExpiresByType application/pdf A604800
|
|
|
|
|
ExpiresByType application/x-httpd-php A604800
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ExpiresByType image/x-icon A2592000
|
2015-06-26 17:07:12 +03:00
|
|
|
</ifModule>
|