.htaccess redirections

Simply redirecting a domain, ending with source to target/index.html

RewriteRule ^source/?$ http://www.test.de/target/index.html [L]

Redirecting can also be done with the Redirect Command

Redirect 301 /source /target/some-folder

Redirecting a complete folder structure can be done like this:

RedirectMatch 301 ^/source/(.*)$ http://mydomain.de/target/$1

Redirect a request for a specific file to a folder (http://www.test/upload/file.pdf -> http://www.test.de/downloads/)
The flag R stands for redirect, L stands for Last (the rule will be executed immediately, without chaining another rule)

RewriteEngine On
RewriteRule ^/?file\.pdf$ http://www.test.de/downloads/ [R, L]