Forum Moderators: phranque
# If URL = (www.)domain1.com send to domain2.dk/$1
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com$ [NC]
RewriteRule ^(.*)$ http://domain2.dk/$1 [R=301,L] # If URL = (www.)domain1.com/index.php?title= etc send to domain2.dk/$1
RewriteCond %{HTTP_HOST} ^(www\.)?domain1\.com/index\.php?title=$ [NC]
RewriteRule ^(.*)$ http://domain2.dk/index.php?title=$1 [R=301,L] http://domain1.com/index.php?title=wiki_article_title_here http://domain2.dk/index.php?title=wiki_article_title_here RewriteCond {REQUEST_URI} index.php
RewriteCond {QUERY_STRING} ?title=.*$
RewriteRule .*$ http://domain2.dk/$1 ^(index\.php)?$ which matches example.com/index.php?param=value as well as example.com/?param=value so that BOTH requests will be redirected to the new URL. Redirect / http://domain2.dk/ domain1.com/index.php?p=123
subdomain.domain1.com/index.php?p=123
domain1.com/index.php?attachment_id=123
subdomain.domain1.com/index.php?attachment_id=123 domain1.com/?p=123
subdomain.domain1.com/?p=123
domain1.com/?attachment_id=123
subdomain.domain1.com/?attachment_id=123 RewriteBase /
RewriteRule ^index\.php$ - [L] domain1.com/2010/07/01/sample-post/ domain1.com/wp-admin/all-kinds-of-settings.php domain1.com/wp-content/uploads/2010/06/image_filename123.jpg # BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
# END WordPress domain1.com/index.php?title=Article_Title_Here
domain1.com/index.php?title=You%27ve_Got_Mail%21
domain1.com/index.php?title=Maxim_maskingev%C3%A6r domain2.dk/index.php?title=Article_Title_Here
domain2.dk/index.php?title=You%27ve_Got_Mail%21
domain2.dk/index.php?title=Maxim_maskingev%C3%A6r /images/f/ff/image.png
RewriteCond %HTTP_HOST ^(www\.)?domain1\.dk
RewriteCond {QUERY_STRING} ^title=([^&]+)
RewriteRule ^(index\.php)?$ http://domain2.dk/?%1 [NE,R=301,L]
RewriteCond %HTTP_HOST ^(www\.)?domain1\.dk
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /(index\.php)?\?title=([^&]+)(&[^\ ]+)\ HTTP/
RewriteRule ^(index\.php)?$ http://domain2.dk/?%2 [NE,R=301,L]
and then rewrite those URLs so that they look like the root?
Shouldn't it be simple to detect whether "index.php?title=" or "index.php?p=" is used, and rely solely on this?