Print Page | Close Window

Making Content Pages NON-Spiderable

Printed From: ProductCart E-Commerce Solutions
Category: ProductCart
Forum Name: Customizing ProductCart
Forum Description: Exchange messages with other users that are customizing ProductCart.
URL: https://forum.productcart.com/forum_posts.asp?TID=1717
Printed Date: 22-April-2025 at 8:37pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Making Content Pages NON-Spiderable
Posted By: allensp
Subject: Making Content Pages NON-Spiderable
Date Posted: 16-June-2008 at 9:54am
We have set up our store to where when you go to the home page you get a screen that has no navigation and a login area.
 
We have it set up for our dealers to be the only ones with access. Our dealers will be signed up manually through us, so they will have their user name and password ONLY through us.
 
My question is: How do I make sure that the entire website is password protected? I don't want search engines to pick up on content URLs and I don't want dealers to have the ability to copy and paste the urls and send links to people.
 
I have already put a robots.txt file in the root telling search engines not to spider, but I have read in several places that this doesn't always work for all search engines.
 
Any ideas? Thank you in advance!



Replies:
Posted By: netprofits
Date Posted: 16-June-2008 at 10:08am

The easiest solution would be to add code to the header.asp file that checks if a visitor is logged in and if not, redirect back to the login page. Since the header.asp file is included in all Product Cart pages, it would always perform the check and no one could view any page without being logged in.

The code for that would be something like the following:
if session("idCustomer")="0" or session("idCustomer")="" then response.redirect("default.asp")
 
Additionally, Product Cart allows both retail and wholesale customers. You can define that when creating the customer account. You can turn of ordering for retail customers and you can also leave the retail price for products blank or 0. Then, even if someone gets to a product page, they could see products but no pricing unless they were logged in as a wholesale customer.

See the User's Guide section on Managing Customers for complete details.



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: allensp
Date Posted: 16-June-2008 at 10:25am

We don't want outside customers to see any of the products - so I like the code idea you gave.

Also, I saw an option in the product cart control panel to turn on SSL at login. If I had a dedicated SSL and turn it on at login - and my homepage is the login screen - would that protect the site from spiders?
 
I am not a genius at coding, so is that the exact code I need that you gave me? If so, is there a certain place on header.asp that I need to put it? Does it need to go right after the <head> tag?

Here is the beginning of my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd - http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<link type="text/css" rel="stylesheet" href="pcStorefront.css" />
<%Response.Buffer=True%>
<%
Set conlayout=Server.CreateObject("ADODB.Connection")
conlayout.Open scDSN 
Set RSlayout = conlayout.Execute("Select * From layout Where layout.ID=2")
Set rsIconObj = conlayout.Execute("Select * From icons WHERE id=1")
%>
<title>Rugged CCTV Shopping Cart</title>
The rest is just divs and styles
 
I appreciate your help so much!


Posted By: netprofits
Date Posted: 16-June-2008 at 10:42am
Try putting the following code as the very first line of header.asp:
<%if session("idCustomer")="0" or session("idCustomer")="" then response.redirect("default.asp")%>
 
You can change default.asp to whatever the name of your home page is within the PC folder, i.e. home.asp is the most common. default.asp just does a redirect to the page you define in the control panel.


-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: allensp
Date Posted: 16-June-2008 at 11:46am
I am sorry but when you say first line do you mean even before this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd - http://www.w3.org/TR/html4/loose.dtd ">
 
or after this:
<link type="text/css" rel="stylesheet" href="pcStorefront.css" />
 
I have tried both ways and every time I try to login it acts like it is going somewhere - and then it quits. I'll keep trying though - it might be my server.


Posted By: allensp
Date Posted: 16-June-2008 at 12:04pm
I might also be doing something else wrong - this is how I have it setup:
 
I have an index.html that is designed with just a banner image, no navigation and has the login form from product cart in the content section.
 
When a customer logs in it takes them to productcart/pc/CustPref.asp, with all their personal info.
 
When I add the code that you gave me to the header.asp file it messes up where the customers go when logged in.
 
The html file does not have any include files in it at all - so it should not be connected to the header.asp file. I made another html page for non-members to be re-directed to that I put in place of the "default" page in the code. When I put the code in the header.asp file, and a customer logs in the are also taken to the non-member page.
 
What could I be doing wrong?
 
I appreciate your help so much!


Posted By: Matt
Date Posted: 16-June-2008 at 12:12pm
It doesn't matter where you put it as long as it is within <% %>.  Make sure the script is not included in the page you redirecting to, otherwise you will create a continuous loop.



Posted By: Matt
Date Posted: 16-June-2008 at 12:18pm
Ok. What is happening is that the customer is not getting logged in. They are being redirected before the login script executes.  


Posted By: allensp
Date Posted: 16-June-2008 at 12:24pm

Where you trying to link to something? It is saying it is on your hard drive...

I think I am doing everything correct...maybe I am just missing something that is right in front of my face.

This is the code on my header.asp file:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" " http://www.w3.org/TR/html4/loose.dtd - http://www.w3.org/TR/html4/loose.dtd ">
<html>
<head>
<link type="text/css" rel="stylesheet" href="pcStorefront.css" />
<%if session("idCustomer")="0" or session("idCustomer")="" then response.redirect("not-member.html")%>
<%Response.Buffer=True%>
<%
Set conlayout=Server.CreateObject("ADODB.Connection")
conlayout.Open scDSN 
Set RSlayout = conlayout.Execute("Select * From layout Where layout.ID=2")
Set rsIconObj = conlayout.Execute("Select * From icons WHERE id=1")
%>
<title>Rugged CCTV Shopping Cart</title>
The divs....
 
This is the code on my not-member.html file:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd - http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml - http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<p>You are not a member - please contact us if you would like to become one. <br />
  <br />
You can shop our retail shop at <a href=" - www.rugged-cctv.com www.rugged-cctv.com">www.rugged-cctv.com</a></p>
<p>Thank you, Rugged CCTV</p>
</body>
</html>
 
Finally, this is the code on my index.html file:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd - http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns=" http://www.w3.org/1999/xhtml - http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
Then a bunch of styles and divs....
<form action="/productcart/pc/checkout.asp?cmode=1" method="post" name="login" id="login">
    User Name
    <input type="text" name="LoginEmail" />
    Password
    <input type="password" name="LoginPassword" />
    <input name="PassWordExists" type="hidden" value="YES" />
    <a href="JavaScript:document.login.submit();">
    <input type="submit" name="Submit" id="Submit" value="Submit" />
    </a>
    <input type="hidden" name="SubmitCO.y" value="1" />
  </form>

Thanks agan for your help.


Posted By: Matt
Date Posted: 16-June-2008 at 12:31pm
The problem is that checkout.asp does not log anyone in because the header file redirects them before the page loads.  A quick workaround is to use a different header for checkout.asp that does not contain the redirect script.


Posted By: Matt
Date Posted: 16-June-2008 at 12:34pm
Actually, the redirect script should also be removed from login.asp.  So you should replace that header as well.


Posted By: allensp
Date Posted: 16-June-2008 at 1:28pm
Okay - You have been so nice, so I am really hoping you don't get tired of me...but here goes:
 
I made a new file called checkout-header.asp and then replaced header.asp include file in the checkout.asp file with checkout-header.asp.
 
Seems like that should have worked - but I also see this other portion in the checkout.asp file that I don't understand and it might be affecting everything (but I am not sure)
 
'Capture any redirects
dim pcRequestRedirect
pcRequestRedirect=getUserInput(request("redirectUrl"),250)
if Session("SFStrRedirectUrl")<>"" AND pcRequestRedirect="" then
else
 Session("SFStrRedirectUrl")=pcRequestRedirect
end if
dim pcPageMode
pcPageMode=request("cmode")
if pcPageMode="" then
 pcPageMode=0
else
 if NOT validNum(pcPageMode) then
  pcPageMode=0
 end if
end if
 
Is this file "Capturing" the redirect?


Posted By: allensp
Date Posted: 16-June-2008 at 1:38pm
oh okay I didn't refresh to see your comment about login...i'll change that and get back to you.


Posted By: allensp
Date Posted: 16-June-2008 at 1:50pm
You are a genius! Thank you so much! That worked perfectly!
 
 


Posted By: netprofits
Date Posted: 16-June-2008 at 1:57pm
Hey, sorry for the delay. I was out of my office for the past couple hours and didn't get to reply back. It looks like Matt resolved the issue. I was also testing out a script that would check the actual filename in the URL and not redirect for certain filenames, i.e. checkout.asp but I didn't get that working yet.

-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: allensp
Date Posted: 16-June-2008 at 2:20pm
That's okay - I really appreciate both of you! It was so nice for both of you to help out!
I can't even express how much this helped me!


Posted By: netprofits
Date Posted: 16-June-2008 at 2:24pm
You're welcome. Just remember that if you make changes to header.asp, you also need to make changes to your other header file that you're using for the checkout and login pages.

-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: allensp
Date Posted: 17-June-2008 at 10:05am
Okay, now I just noticed that when I try to do an order I make it all the way to the "Summary" page: productcart/pc/OrderVerify.asp and when I hit continue, which should take me to SaveOrd.asp it comes back with my NOT a MEMBER message. Is there a code I need to change in SaveOrd.asp?
 
I don't see an include file for header.asp.


Posted By: allensp
Date Posted: 17-June-2008 at 10:06am
Or could it have something to do with me not having my SSL Certificate set up yet?


Posted By: netprofits
Date Posted: 17-June-2008 at 10:32am

It sounds like your session was lost. This usually happens if the URL changes from something like yourdomain.com to http://www.yourdomain.com - www.yourdomain.com . Having or not having the SSL would not clear the session but if the domain changed when going past OrderVerify. The SSL URL is set in the control panel under the Settings | Store Settings area. Make sure you start with the same URL (i.e. with or without the sarting www) when you first go to the site as what the SSL pages would use.



-------------
NetProfits Internet Consulting

Certified ProductCart Developer

http://www.nicwebdesign.com" rel="nofollow - Our Site


Posted By: allensp
Date Posted: 17-June-2008 at 10:56am
I think I know what is happening. I just changed it from the old temporary url to the "real" one and the SSL certificate is still being installed. At least I think that is what is wrong. I'll see if it resolves itself in a couple of hours.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net