So I want to redirect subdomain.domain1.com to domain2.com. What's the easiest way to do it?
also whats the correct line for non-www to www redirect
So I want to redirect subdomain.domain1.com to domain2.com. What's the easiest way to do it?
also whats the correct line for non-www to www redirect
Place the following HTML redirect code between the <HEAD> and </HEAD> tags of your HTML code.
<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">
The above HTML redirect code will redirect your visitors to another web page instantly. The content="0; may be changed to the number of seconds you want the browser to wait before redirecting.
put these lines in your .htaccess
# redirect from old domain to new domain
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*) http://www.newdomain.com/$1 [R=301,L]
# redirect non-www to www
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
small, I just tried this and got a Redirect Loop.
what is a Redirect Loop?![]()
apparently it's when you get an error page that says 'Redirect Loop'
A redirect loop is when you redirect one URL to a second URL, which redirects it back to the first URL.
This is what I use for simple domain redirects:
It seems to be that you should simply be able to put that in a file in the directory where that subdomain used to be served. (Warning: I have not tested this...)Code:Redirect 301 / http://www.example.com
Submit Your Webmaster Related Sites to the NB Directory
I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.
Can't you do this in Cpanel? I just re-directed a domain to another domain in Cpanel and it was really easy.
I assume that you can also re-direct a subdomain to a domain in Cpanel, haven't tried it, though.
Everything is possible to make... Preliminary searches for answers to these questions.
What is a subdomain? What is a directory (the server)? What is the top-level domain? What is the difference between the subdomain and directory ?
If, after the answers and still have the need for redirects ...
sulumits retsambew
sulumits retsambew
Learn, learn and learn only. Why learn ? Albert Einstein died, Nikola Tesla died, and nor I do not feel so the best...
I just use cpanel for this. It is extremely simple and takes less than a minute.
Bookmarks