/title/something should redirect to /node/1234 instead of displaying the node by itself

inducer@news.ti... - January 5, 2005 - 12:39
Project:Title
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Since users tend to link to what's in their URL bar, it would be desirable if the permanent (/node/something) URL was in the URL bar even if they arrived via a /title/something link. The attached patch fixes this.

This also fixes this bug.

AttachmentSize
title-2005-01-05-redirect-v01.patch576 bytes

#1

kurkuma - November 10, 2005 - 17:09
Version:<none>» HEAD

I have been using drupal_goto() instead of head() (in drupal 4.6.3) as it recomends in drupaldocs.org:

It is advised to use drupal_goto() instead of PHP's header(), because drupal_goto() will append the user's session ID to the URI when PHP is compiled with "--enable-trans-sid".

The code will be as follows (starting in line 45):

<?php
else if (db_num_rows($result) == 1) {
 
$node = db_fetch_object($result);
 
//$node = node_load(array('nid' => $node->nid));
  //print theme('page', node_show($node, NULL), $node->title);
 
drupal_goto("node/".$node->nid); //better take you to the page instead of loading the page ;-)
 
}
?>

#2

cybe - November 11, 2005 - 12:19
Status:needs review» reviewed & tested by the community

Oh =) It does work now.. Strange, last I tried it didn't... Thanks for the patches

#3

cybe - November 11, 2005 - 12:22

ugh sorry, my last comment was meant for this thread: http://drupal.org/node/31069

#4

Tobias Maier - November 11, 2005 - 13:19
Status:reviewed & tested by the community» needs review

why not changing this back to code need review?

 
 

Drupal is a registered trademark of Dries Buytaert.