Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

301 redirect

Status
Not open for further replies.

besnette1

Technical User
Jun 19, 2001
9
Hi there,
I have a site that has a url structure similar to this:


I have been getting some errors when people try to access the site without the URL paramater being passed (i.e.)



I have been trying to do a 301 for this, but I can't get it to work. I have pasted what I have done below - any ideas would be greatly appreciated.

<cfif domain EQ " AND NOT ISDEFINED ("URL.ItemID")>
<cfheader statuscode="301" statustext="Moved permanently">
<cfheader name="Location" value=" </cfif>
 
Why don't you just do this?

Code:
<cfif NOT IsDefined("URL.Item")>
 <cflocation url="index.cfm" />
</cfif>

This will redirect to the home page if there's not an item parameter specified..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top