Skip to content

Instantly share code, notes, and snippets.

@alexrinass
Created May 7, 2011 11:35
Show Gist options
  • Save alexrinass/960430 to your computer and use it in GitHub Desktop.
Save alexrinass/960430 to your computer and use it in GitHub Desktop.
Apache .htaccess template
# Error documents
ErrorDocument 404 /404.htm
ErrorDocument 403 /403.htm
#RedirectMatch permanent ^/somedir/?$ http://www.domain.com/
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /
# redirect domains without www
#RewriteCond %{SERVER_ADDR} x.x.x.x
#RewriteCond %{HTTP_HOST} !^www\.domain\.com$
#RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
# maintenance
#RewriteCond %{REQUEST_URI} !/maintenance/
#RewriteRule ^.*$ http://{DOMAIN}/maintenance/ [R=temp]
# Weitere Regeln
#RewriteRule ^some/url/?$ /target/url/
# Dispatcher rewrite
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment