Simple as the title sounds

CommentFileSizeAuthor
#1 933888-redirect-nid-shorturl-D7.patch3.19 KBdave reid

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new3.19 KB
dave reid’s picture

This should probably alter the link rel='shortlink' output on node pages.

grendzy’s picture

Nice. Is calling node_load in a redirect_url_inbound_alter() OK? I thought that was usually considered to be on the critical path... It seems like there's no harm in redirecting to a node ID that may not exist.

mlncn’s picture

Big Plus One for this feature, much better to do this in redirect than a custom module.

Regarding node_load, if it is a node page the node is cached, if it isn't i don't think the call matters much.

Note that something like:

 if (is_numeric(substr($path, strpos($path, '/')))) 

would allow http://example.com/53/edit to work

Is Redirect module as a whole in a testable state? I haven't installed, it looked like key parts of the code are commented out.

Let me know if i can help.

benjamin, agaric

Status: Needs review » Needs work

The last submitted patch, 933888-redirect-nid-shorturl-D7.patch, failed testing.

wiredescape’s picture

Any update on Shortlink URL redirect to canonical URL feature?

manoloka’s picture

Issue summary: View changes

Any chance to get this patch fixed?

Thanks

manoloka’s picture

Hi there,

I´ve just done something pretty simple that redirects all my domain.com/1234 to domain.com/node/1234 (I use clean urls, global redirect and pathauto so that takes them to the proper url eg.domain.com/cat1/subcat2/whatever)

I'm no programmer so this may have consequences that I can not foresee ... so far so good, please advice.

I´ve added to my .htaccess this piece of code that I found somewhere on the net.

  # Allow short URLs of the form example.es/123 that redirect to example.es/node/123
  
  RewriteRule ^(\d+)$ index.php?q=node/$1 [L,QSA]
wylbur’s picture

Status: Needs work » Closed (outdated)

Closing this as Outdated as Drupal 7 is EOL.