Is it possible to prevent users from viewing content at example.com/node? This url, of course, returns content that has been promoted to the front page, which in my case includes several different content types. These varying content types, when viewed out of context, are a little confusing to my users. I have set up blocks to augment the information on the event page, blog page, etc... When the content is viewed at the example.com/node url, these blocks are absent.

I have not got any links to the example.com/node url in my site (that I can think of), but did set up url aliases to direct requests for index.rdf, rss.xml, et al to "node/feed." Is this how google is indexing my node page?

Thanks in advance.

Bjorn
--
http://choirgeek.com

Comments

killes@www.drop.org’s picture

I am afraid you cannot do this. my normal answer would be to disable /node through the menu module but this would probably break /node/add too.
--
If you have troubles with a particular contrib project, please consider to file a support request. Thanks.

bjornarneson’s picture

Could I redirect the example.com/node url in .htaccess? Of course, I'd have to leave ...node/add, ...node/xxxx, etc... alone. Would this technique break anything in Drupal?

--
Bjorn
http://choirgeek.com
because there's no 'I' in ensemble

killes@www.drop.org’s picture

Should work if your craft your regexps carefull enough.
--
If you have troubles with a particular contrib project, please consider filing a support request. Thanks. And, by the way, Drupal 4.5 does not work with PHP 5.

torne’s picture

If it's ok to have the page present but blank, then edit node.module so that the default page doesn't actually bother to retrieve any nodes; it'll then just be a blank page with the normal header and sidebar boxes. That might well convince Google that it's not interesting...

willmoy@www.civicspacelabs.org’s picture

To stop google indexing a file, a robots.txt file at example.com/robots.txt configured as per the instructions on google.com will do the job for sure.

bjornarneson’s picture

I think that this would probably satisfy my need. I could prevent crawling of example.com/node using these robots.txt lines:

User-agent: *
Disallow: /node

But then how to allow crawling of "node/1," "node/2," etc...? I believe that the robots.txt lines above disallow robots for all children.

--
Bjorn
http://choirgeek.com
because there's no 'I' in ensemble

bjornarneson’s picture

Just found page at http://www.google.com/webmasters/3.html which demonstrates how to use '$' to indicate end of a name.

User-agent: Googlebot
Disallow: /node$
Disallow: /?q=node$

This technique only applies to Googlebot. As I understand it, this exclusion applies only to the example.com/node url, not .../node/1, .../node/2, etc. I'm going to give it a try...
--
Bjorn
http://choirgeek.com
because there's no 'I' in ensemble

no2e’s picture

This is an old thread, but I have the same problem: is there a other solution now?
I want to deactivate example.com/[b]node[/b]. At the moment it's the "Welcome to your new Drupal website!" page. I set up a different homepage (node/1), but when you browse to /node, you still get this page.

js’s picture

using .htaccess is the most straight forward, but I did this:

at the top of my template.tpl.php as a convenience

<?php

/**
* Redirect from /node
*/
if ($_SERVER['REQUEST_URI'] == '/node') {
header('Location: http://' . $_SERVER['HTTP_HOST'],TRUE,301);
exit;
}

ayesh’s picture

Light-weight solution:
use Views to overide the default front page(/node) and under Access Control, restrict access.

I'm not sure that this will prevent /node/X from being accessing.

Robots.txt trick should work.