433 items | 95 visits
drupal is my choice of CMS frameworks
Updated about 21 hours ago
Created on 2008-04-24
Category: Computers & Internet
URL:
blocks don't load the node, hence the arg and nid approach. this will do what you want, but only works in Drupal 6.
parent method will work, but only two levels deep. you'll have to add a bit more logic if you want it to work with children of children.
<?php
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
if ($node->book['bid']==41) {
return TRUE;
}
else {
return FALSE;
}
}
?># non empty HTTP_HOST in the request
RewriteCond %{HTTP_HOST} !^$ [NC] #here you exclude a domain from the universal rules
RewriteCond %{HTTP_HOST} !^www\.excepteddomain\.com$ [NC]
RewriteCond %{HTTP_HOST} !^excepteddomain\.com$ [NC]
# the hostname does start with 'www.'
RewriteCond %{HTTP_HOST} ^www\. [NC]
# let's extract the hostname without 'www.' and save it to %1
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
# let's redirect to the extracted hostname, $1 saves the URL
RewriteRule ^(.*)$ "http://%1/$1" [L,R=301]#here are the rules for the excepted domain
RewriteCond %{HTTP_HOST} excepteddomain\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\.excepteddomain\.com$ [NC]
RewriteRule ^(.*)$ http://www.excepteddomain.com/$1 [L,R=301]
433 items | 95 visits
drupal is my choice of CMS frameworks
Updated about 21 hours ago
Created on 2008-04-24
Category: Computers & Internet
URL: