welcome: please sign in
mod rewrite

Recipes!

Redirecting MSIE users to a different site

RewriteEngine On

# Match documents
RewriteCond $1 \.(s?html?¦php[1-9]?)$ 

# Don't match indexes
RewriteCond $1 !/?index\.(s?html?¦php[1-9]?)$ 

# Match an IP
RewriteCond %{REMOTE_ADDR} ^123\.123\.123\.123$ 

# Match a browser
RewriteCond %{HTTP_USER_AGENT} !^Mozilla/[0-9.]+\ \([^)]+\)\ Gecko/20[0-9]{6}\ Firefox/[0-9.]+ 

# Redirect!
RewriteRule (.*) http://www.example.com/ [R=301,L] 

mod_rewrite (last edited 2010-04-24 09:29:33 by localhost)