Using .htaccess to redirect from one domain to another
snippet in htaccess

Using .htaccess to redirect from one domain to another

user4947

RewriteEngine On

RewriteRule ^(.*)$ http://www.example.com/$1 [R=301]

Using .htaccess to redirect from one domain to another

user737

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# New code to redirect from example.net to example.com
# Permanent redirect for caching purposes, also include the query string
RewriteCond %{HTTP_HOST} ^example\.net
RewriteRule (.*) http://example.com/$1 [R=permanent,QSA,L]

# New code to redirect from www.example.net to www.example.com
RewriteCond %{HTTP_HOST} ^www\.example\.net
RewriteRule (.*) http://www.example.com/$1 [R=permanent,QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

AddHandler php5-script .php