Forum Moderators: phranque
http://mysite.com/~mysite/index.php?var1=var
from http://mysite.com/~mysite/index.php?var1=var
to http://mysite.com/index.php?var1=var
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^mysite.com$ [NC]
RewriteRule ^(.*)$ http://mysite.com/$1 [L,R=301]
RewriteRule ^~mysite/(.*) http://example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(example\.com)?$
RewriteRule (.*) http://example.com/$1 [R=301,L] The first rule will need to go in a higher level folder, above the /~mysite/ folder.
What happens if you try simply
RewriteRule (~|%7E)mysite(.*) http://example.com$2 [R=301,L]