How to redirect domain

m
m
 
Line 4: Line 4:
  
 
<div align="justify">'''Redirect/redirection''' is a way of forwarding site visitors to a different web page than the one they request. This is done for various reasons (e.g. the original page is unavailable or is still being designed).
 
<div align="justify">'''Redirect/redirection''' is a way of forwarding site visitors to a different web page than the one they request. This is done for various reasons (e.g. the original page is unavailable or is still being designed).
You can redirect domain either via cPanel or via .htaccess file. This tutorial will explain how to create a domain redirect in your hosting account cPanel.
+
You can redirect domain either via cPanel or via .htaccess file. This tutorial will explain how to create a domain redirect in your [http://myidealhost.com/hosting.shtml cPanel hosting] account.
  
  
Line 17: Line 17:
 
* You can set either the '''''Temporary 302 redirect''''' or the '''''Permanent 301 redirect'''''.
 
* You can set either the '''''Temporary 302 redirect''''' or the '''''Permanent 301 redirect'''''.
  
* Select whether to redirect '''''with''''' or '''''without www'''''. preceding the URL. This will allow you to redirect either www.your_domain.com or your_domain.com or both to the desired destination.
+
* Select whether to redirect '''''with''''' or '''''without www'''''. preceding the URL. This will allow you to redirect either www.your-domain.com or your-domain.com or both to the desired destination.
  
 
* Click the ''''''Wild Card Redirect'''''' box if you want to redirect all files within a directory to the same filename in the new directory.
 
* Click the ''''''Wild Card Redirect'''''' box if you want to redirect all files within a directory to the same filename in the new directory.
  
Example: If your_domain.com redirects to your_domain1.com,  
+
Example: If your-domain.com redirects to your-domain1.com,  
then a visitor trying to access your_domain.com/somefile.html  
+
then a visitor trying to access your-domain.com/somefile.html  
 
will be redirected to your_domain1.com/somefile.html.</div>
 
will be redirected to your_domain1.com/somefile.html.</div>
  
 
  {{#icon: How_to_redirect_domain_via_cPanel.png|How to redirect domain}}
 
  {{#icon: How_to_redirect_domain_via_cPanel.png|How to redirect domain}}
 
----
 
----
<span style="color:#B0C4DE"><FONT SIZE="+1">'''Redirect in htaccess (http and https redirects)'''</FONT></span>
+
<span style="color:#B0C4DE"><FONT SIZE="+1">'''Redirect in .htaccess (http and https redirects)'''</FONT></span>
  
 
<div align="justify">The previous tutorial (see above) explaines how to set a domain redirect via '''cPanel'''. Now you'll be provided with the info needed to create http redirect with '''.htaccess file'''.
 
<div align="justify">The previous tutorial (see above) explaines how to set a domain redirect via '''cPanel'''. Now you'll be provided with the info needed to create http redirect with '''.htaccess file'''.
  
In order to set '''htaccess redirect''' you need to access .htaccess file first. This can be done either via your '''cPanel File Manager''' or via any '''FTP''' software. .htaccess file for your main domain  is located within 'public_html' folder.
+
In order to set '''.htaccess redirect''' you need to access .htaccess file first. This can be done either via your '''cPanel File Manager''' or via any '''FTP''' software. .htaccess file for your main domain  is located within 'public_html' folder.
 
    
 
    
 
You can create both http redirect and https redirect (permanent 301 redirect) by adding the following rules to your .htaccess file.
 
You can create both http redirect and https redirect (permanent 301 redirect) by adding the following rules to your .htaccess file.

Latest revision as of 10:52, 26 October 2012

rss feed for my website