Darksat IT Security Forums
October 22, 2019, 02:16:35 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Darksat IT Security Forum
From Firewall Support, AntiVirus Questions, Spyware problems, Linux and Windows Security, Black Hat SEO right down to Website Design and Multimedia
 
  Home Help Search Gallery Links Staff List Login Register  

301 redirects


Pages: [1]
  Print  
Author Topic: 301 redirects  (Read 2155 times)
Darksat
Administrator
Master
*******
Posts: 3303



View Profile WWW
« on: August 22, 2006, 07:35:24 am »

A 301 redirect is a method of telling search engines and visitors that a page had permanently moved to a new location.
it automaticly forwards the visitor to the new page/site
There are several ways of doing this.

Redirect in PHP
Code:
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>


Redirect in ASP
Code:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"
>

or for something a bit more advanced
eg redirecting all versions of yoursite.com/pagename.htm to www.yoursite.com/pagename.htm
.htaccess
Code:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.yoursite\.com [NC]
RewriteRule (.*) http://www.yoursite.com$1 [R=301,L]
Report Spam   Logged

neutron2k
Elite-Member
Master
*****
Posts: 469



View Profile WWW
« Reply #1 on: August 22, 2006, 09:33:54 am »

nice post Smiley

Can i make a suggestion? You should change the asp code title to 'Adding Redirect Headers' in asp.

redirects in asp / .net work as:

Code:
response.redirect("url")
Report Spam   Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
eXTReMe Tracker
Security Forum
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy
Page created in 0.031 seconds with 13 queries.