Modrewrite Code-Beispiele

Tags: | |

Von http:// auf https:// umleiten

RewriteCond     %{SERVER_PORT}   !^443$
RewriteRule     (.*)             https://%{HTTP_HOST}/$1   [L]

Von https:// auf http:// umleiten

RewriteCond     %{SERVER_PORT}   ^443$
RewriteRule     (.*)             http://%{HTTP_HOST}/$1   [L]

Bilderklau verhindern:

RewriteCond %{HTTP_REFERER} !^http://domainname.tld [OR]
RewriteCond %{HTTP_REFERER} !^http://www.domainname.tld [OR]
RewriteCond %{REQUEST_URI} !^.+ersatzbild.+$

RewriteRule ^.+.(gif|png|jpg|jpeg)$ http://www.domainname.tld/ersatzbild.png [NC,R,L]

Hinterlassen Sie einen Kommentar

Text-Formatierung: Sie können diese XHTML-Tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> benutzen.