301 Server Code

A "301" is a status code that is returned by a website’s server when accessing a url that has been moved. Just like mail forwarding, a 301 specifies a permanent "change of address" for a page/file which has been moved. A 301 indicates a permanent redirection whereas a 302 indicates a temporary redirection.


Examples

Redirect from WWW to Non-WWW

To make the primary version of your website as http://www.yourdomain.com instead of http://yourdomain.com add a redirect as follows:

								
RewriteEngine On RewriteBase / 

 RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] 

 RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
								
							
Format: html

Redirect from Non-WWW to WWW

To make the primary version of your website as http://yourdomain.com instead of http://www.yourdomain.com add a redirect as follows:

								
RewriteEngine On

 RewriteCond %{HTTP_HOST} !^www\. 
 
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

								
							
Format: html

CSS

CSS Test

								
.highlight {

padding: 9px 14px;

margin-bottom: 14px;

background-color: #f7f7f9;

border: 1px solid #e1e1e8;

border-radius: 4px;

text-align: left;
\/* display: block; */

}

								
							
Format: css

There are no posts.

View Count: 12