از .htaccess استفاده کنید ...
کد PHP:
RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://dostanweb.com/$1 [LR=301] RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC] RewriteRule ^(.*)$ http://www.dostanweb.com/$1 [LR=301]