RewriteEngine on # If your site can be accessed both with and without the 'www.' prefix, you # can use one of the following settings to redirect users to your preferred # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option: # # To redirect all users to access the site WITH the 'www.' prefix, # (<a href="http://example.com/" title="http://example.com/">http://example.com/</a>... will be redirected to <a href="http://www.example.com/" title="http://www.example.com/">http://www.example.com/</a>...) # adapt and uncomment the following: # RewriteCond %{HTTP_HOST} ^example\.com$ [NC] # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301] #
# Block access to SVN files to the outside world <IfModule mod_rewrite.c> RewriteRule ^(.*/)?\.svn/ - [F,L] ErrorDocument 403 "Access Forbidden" </IfModule>
RewriteCond %{query_string} ^([a-zA-Z0-9\-\/\.]+)$ [NC] RewriteRule ^(.*)$ <a href="http://example.com/phrase%1" title="http://example.com/phrase%1">http://example.com/phrase%1</a>? [R=301,L]
RewriteCond %{query_string} ^\/blog\/.*$ [NC] RewriteRule ^(.*)$ <a href="http://example.com/blog/" title="http://example.com/blog/">http://example.com/blog/</a>? [L,R=301]
This takes the query string, evaluates it, and then redirects to a url and discards the query sting.
<FilesMatch ".html"> ForceType application/x-httpd-php </FilesMatch>
Forward requests for local files to Amazon S3
RedirectMatch /path/to/assets/folder/(.*) http://s3.amazonaws.com/domain/assets/folder/$1
Redirect 301 /path/to/file.html http://www.domain.com/path/to/new-file.html