I'm going to move a site from a subdomain to new domain. How to redirect traffic using cpanel ? or its better use php header redirection ? I have another site which has some missing pages and i want to missing pages redirect to the home page. How you do it using cpanel ? .
cPanel is a control panel, it doesn't redirect traffic. You should just edit your DNS so that the subdomain redirects to the domain. You should be able to use cPanel to edit this configuration. This makes much more sense than using PHP or Apache redirect since it's less overhead.
Well I used a 301 redirect. Had to do for more 250 pages line by line. But still it was the best option i guess. .
Hi, lol, ouch... You should have done the redirect with a .htaccess file. RewriteEngine on rewritecond %{http_host} ^subdomain.example.net [nc] rewriterule ^(.*)$ http://www.example.net/$1 [r=301,nc] DNS doesn't do redirects either. I assume you mean making the subdomain a CNAME pointing to the domain. This would not work unless the sub-domain is setup as an alias in the vhost configuration and it would still not be redirecting but showing the same content with the sub-domain in the address url.
Incorrect, you're making a generalization of DNS software. There's more than BIND. Just to give you an example, when I used Namecheap to host my DNS, I can re-direct a subdomain to another domain.
Ahh, but that is different - it uses both DNS and HTTP. There is no method in the DNS RFCs for allowing redirects. The redirect is done via http 301 redirect. In your example what happens with namecheap is that when you set up a redirect they point your domain to one of their web servers via a standard A record. This web server is configured to do nothing but look up the URL it should redirect to for your host name and then do the redirect. I know this seems like a very fine line but it is extremely important to understand when attempting to diagnose issues. A similar feat can be accomplished if you were to add the domain (or sub-domain) as an add-on domain in cPanel and then placed a .htaccess file in the add-on domains folder.