Old website of mehl.mx
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

RewriteEngine on
RewriteBase /
## Redirect other domains
RewriteCond %{HTTP_HOST} !^mehl\.mx$
RewriteRule ^(.*)$ http://mehl.mx/$1 [L,R=301]
## Nice URLs
# Rewrite URL/de to URL/index.de.php
RewriteRule ^(..)/?$ /index.$1.php
# Rewrite e.g. URL/en/contact to URL/contact.en.php
RewriteRule ^(..)/([A-Za-z]+)/?$ /$2.$1.php
# Rewrite empty URL to standard index page
RewriteRule ^/?$ index.de.php
# Rewrite e.g. URL/contact to URL/de/contact and make it visible
RewriteRule ^([A-Za-z]+)/?$ /de/$1 [R=301,L]
## 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
# Forbid .git folder
RedirectMatch 404 /\.git
## SSL
# Enforce SSL
# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}
# Compression
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
# Caching
<ifModule mod_expires.c>
# 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