Files
website-mehlmx/.htaccess

62 lines
1.8 KiB
ApacheConf

RewriteEngine on
RewriteBase /
## www-Redirection
#RewriteCond %{HTTP_HOST} !^max-mehl\.com$
#RewriteRule ^(.*)$ https://max-mehl.com/$1 [L,R=301]
#RewriteCond %{HTTP_HOST} !^mehl\.mx$
#RewriteRule ^(.*)$ http://mehl.mx/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^(.*)\.mehl\.mx$ [NC]
RewriteRule ^(.*)$ http://mehl.mx/$1 [L,R=301]
## Alias Domain
RewriteCond %{HTTP_HOST} max-mehl.com$ [NC]
RewriteRule ^(.*) http://mehl.mx/$1 [R=301,L]
## 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
## SSL
# HTTPS-Verschluesselung erzwingen
# RewriteCond %{SERVER_PORT} !^443$
# RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}
# Compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
# Caching
<ifModule mod_expires.c>
# A = access <seconds>
ExpiresActive On
ExpiresDefault A300
ExpiresByType text/html A300
ExpiresByType text/plain A300
ExpiresByType application/x-javascript A3600
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
</ifModule>