LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-20-2006, 02:35 PM   #1
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Rep: Reputation: 31
Preventing google from indexing a link


I'm helping with a website which uses an "Add to Cart" button which is a link to a php script with GET variables which updates the cart and then uses header("Location: whatever.html"); to return the user to the original page. We need to prevent google from listing this link in search results. I've read that using rel="nofollow" only causes the link to not carry any weight-- but doesn't actually exclude from the index. Is there any way to keep robots--specifically google-- from indexing those links?
 
Old 06-20-2006, 02:41 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You can use a robots.txt file or meta tag. Google, like all well behaved indexing services honors them. The meta tag you are looking for is specifically:

Code:
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
 
Old 06-20-2006, 02:46 PM   #3
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Original Poster
Rep: Reputation: 31
Right, but there are two problems. The specific file I don't want listed is update.php in the cart folder. The robots.txt blocks /cart/ from being crawled, however, since there are links to /cart/update.php in the main site, those are being indexed. Say /index.html has a link to /cart/update.php?add_item=123. Google then adds /cart/update.php?add_item=123 to it's search results.

I can't use a META tag in update.php as it doesn't have any output and thus nowhere to put a META tag. It updates a session variable and returns to /index.html using header("Location: index.html"); PHP function.

- Micah
 
Old 06-20-2006, 06:34 PM   #4
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
http://www.robotstxt.org/wc/exclusion-admin.html

the info at the bottom of the page may help.
 
Old 06-20-2006, 06:49 PM   #5
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Original Poster
Rep: Reputation: 31
Thank you. However, I already have /cart/ blocked in robots.txt. The links still get indexed though because they are linked from pages on the home page. So the page doesn't get crawled via /cart/, but still gets listed in search engine results.
 
Old 06-21-2006, 09:54 AM   #6
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
ah. so even if you specify a particular filename (update.php) it still crawls it since there is an external link? or because of the ?xxx params on the url?
 
Old 06-21-2006, 10:56 AM   #7
MicahCarrick
Member
 
Registered: Jul 2004
Distribution: Fedora
Posts: 241

Original Poster
Rep: Reputation: 31
Well, I suppose both of those reasons. I'm not entirely sure how it works. But I know that even though it's not be crawled, it's still being listed in the google search.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Another Google App., Another Google Yawn LXer Syndicated Linux News 0 06-07-2006 02:21 AM
LXer: The Google Command List: Data Mining using Google LXer Syndicated Linux News 0 01-21-2006 03:31 PM
LQ wiki is a google sponsered link titanium_geek LQ Suggestions & Feedback 3 07-26-2005 04:02 PM
Folder indexing joey52 Linux - Newbie 2 02-18-2005 03:05 AM
RH9 + D-link 704P router can't browse google cmbreaks Linux - Networking 0 08-13-2003 08:53 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration