Forum Moderators: phranque
http://subdomain.olddomain.com/index.php?many_variables_here http://subdomain.NEWdomain.com/index.php?many_variables_here
RewriteCond %{QUERY_STRING} sub.olddomain
RewriteRule ^sub.olddomain sub.newdomain [R=301,L]
RewriteCond %{HTTP_HOST} ^(sub\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://sub.newdomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^subdomain1\.olddomain\.com [NC]
RewriteRule ^(.*)$ http://sub.newdomain.com/$1 [R=301,L]
http://sub.newdomain.com/sub/index.php?variables_here [edited by: echoniner at 7:42 am (utc) on Oct 23, 2010]
Thanks. It seems to be redirecting, except the above code redirects to:
http://sub.newdomain.com/sub/index.php?variables_here
sub.domainnew.com setup to the folder public_html/sub sub.domainold.com setup to same folder public_html/sub Options -Indexes
#Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.olddomain\.com [NC]
RewriteRule ^(.*)$ http://sub.newdomain.com/$1 [R=301,L] http://sub.olddomain.com/index.php?variables http://sub.newdomain.com/sub/index.php?variables RewriteRule ^old-URL-path$ http://example.com/new-URL-path [R=301,L] RewriteRule ^URL-path$ /filepath [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.olddomain\.com [NC]
RewriteRule ^(.*)$ http://sub.newdomain.com/$1 [R=301,L]
http://sub.olddomain.com/index.php?variables http://sub.newdomain.com/sub/index.php?variables
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain\.newdomain\.com [NC]
RewriteRule ^(.*)$ http://www.olddomain.com/$1 [R=301,L]
[Sun Oct 24 23:45:26 2010] [error] [client IP] File does not exist: /home/mylogin/public_html/olddomain/404.shtml
[Sun Oct 24 23:45:26 2010] [error] [client IP] File does not exist: /home/mylogin/public_html/olddomain/olddomain/
RewriteCond $1 !^site-files/
RewriteCond %{HTTP_HOST} ^(www\.)?(([^.]+)+)\.com(\.?:[0-9]+|\.)$
RewriteRule ^(.*)$ /site-files/%2/$1 [L]
Options +FollowSymlinks
RewriteEngine On
RewriteCond $1 !^site-files/
RewriteCond %{HTTP_HOST} ^(www\.)?(([^.]+)+)\.com(\.?:[0-9]+|\.)$
RewriteRule ^(.*)$ /site-files/%2/$1 [L]
#
# -Disallow subdomain calls to this add-on domain:
#
RewriteEngine on
RewriteCond %{HTTP_HOST} ^olddomain.newdomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.newdomain.com$ [NC]
RewriteRule ^(.*)$ "http\:\/\/www\.newdomain\.com$1" [R=301,L]
URL www.newdomain.com/olddomain.com/ URL www.olddomain.com
Options +FollowSymlinks
RewriteEngine On
Redirect /olddomain.com http://www.olddomain.com
# prevent infinite loops in the .htaccess files following rewrite conditions
RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html|error/).* [NC]
RewriteRule .* - [L]
RewriteCond %{HTTP_HOST} ^olddomain.newdomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.newdomain.com$ [NC]
RewriteRule ^(.*)$ "http\:\/\/www\.newdomain\.com$1" [R=301,L] olddomain.newdomain.com:80 which is a valid request; remove the end anchor. ^olddomain.newdomain.com$ OR
^www.olddomain.newdomain.com$ ^(www\.)?olddomain\.newdomain\.com
Options +FollowSymlinks
RewriteEngine On
RewriteRule /olddomain.com http://www.olddomain.com [R=301,L]
URL http://www.newdomain.com/olddomain.com/file.php URL http://www.olddomain.com/file.php URL http://www.newdomain.com/olddomain.com/ URL http://www.olddomain.com
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com\/olddomain\.com [NC]
RewriteRule ^(.*)$ http://www.olddomain.com$1 [R=301,L]
Options +FollowSymLinks
RewriteEngine on
#
# Redirect client requests for "/oldomain.com/" file storage directory path in newdomain.com's
# URL-space to olddomain.com's root URL-space (in other words, 'hide' the fact that
# olddomain.com's files are stored as a subdirectory in newdomain.com's filespace)
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com [NC]
RewriteRule ^olddomain\.com/(.*)$ http://www.olddomain.com/$1 [R=301,L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?newdomain\.com [NC]
RewriteRule ^(.*)$ http://www.olddomain.com/$1 [R=301,L] RewriteRule ^(.*)$ http://www.olddomain.com$1 [R=301,L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com\/sub [NC]
RewriteRule ^(.*)$ http://sub.mydomain.com/$1 [R=301,L]
RewriteEngine on
#
RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com [NC]
RewriteRule ^sub/(.*)$ http://sub.mydomain.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /sub/
RewriteRule ^sub/(.*)$ http://sub.mydomain.com/$1 [R=301,L]