Closed (outdated)
Project:
Short URL
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Jun 2010 at 11:40 UTC
Updated:
13 Apr 2026 at 09:52 UTC
Jump to comment: Most recent
Comments
Comment #1
icecreamyou commentedShorten URLs gets shortened URLs from dozens of services. It can only provide a full URL as a token. The Short URL module, however, is the one that actually processes short URLs for your site specifically, so it is the one that would be providing such tokens.
Comment #2
yngens commentedThank you, IceCreamYou, for clarifying that to me and transferring the issue to the right place.
Dear maintainers of Short URL, can you change the module so it provides right token to pathauto module, please.
Comment #3
irakli commentedI believe this is feature request rather than a bug.
Comment #4
yngens commentedDear Irakli,
I thought it is a bug for Shorten module when I noticed paths like: http://mysite.com/wwwmysitecomlqy and the issue had been transferred here as such. However, for Short URL module it, of course, should be feature request. And I hope it can be realized, because some people might really want to use Short URL's possibilities with pathauto, and with current state it doesn't make much sense to repeat website's address in shortened part of path.
Comment #5
icecreamyou commentedHonestly it probably doesn't make any sense to use a Short URL token with Pathauto. What Pathauto does is create aliases to URLs, but Short URL already does that, so you'd basically just be creating two identical aliases for the same URL. A token would be useful in other places though.
Comment #6
irakli commentedI agree.
Comment #7
yngens commentedI would like visitors of my site access nodes on and see address like http://mysite.com/lqy only. I don't have to use use pathauto if I can make short ruls seen by default instead of paths like node/[nid]. How can i do that without pathauto?
Comment #8
ddorian commentedif i understand you dont want visitors to go to node/node_id url right? then check globalredirect and use it with pathauto
it will redirect node/node_id to whatever you set the url alias with pathauto
Comment #9
yngens commentedddorian,
the problem is that pathauto has only one token for shortened url - [url], and when one uses it she gets: http://mysite.com/wwwmysitecomlq instead of http://mysite.com/lq
there should be some way to pass shortened part, in this case 'lg' to pathauto as url alias.
Comment #10
yngens commentedIceCreamYou, I completely agree with what you wrote above:
I really do not want to create double aliases for the same URL.
Can you consult how can I make my Drupal installation use aliases for noded created by Short URL as clean urls, please? I would like the visitors of my site see short urls in their browsers address lines, not 'node/[nid]' or pathauto generated aliases. Could I explain myself?
Comment #11
icecreamyou commentedWell I don't think Short URL actually uses the {url_alias} table, so to the best of my knowledge it won't work with Global Redirect. Pathauto would be one way around that; I don't know of any other way that does not involve writing code. It's not particularly complex code though -- maybe even something that could go into ShortURL itself.
But it's irakli's module, not mine, so maybe he knows something I don't.
Comment #12
irakli commentedInteresting point.
Right now, ShortURL creates redirects (!) not aliases. Redirect is always HTTP 301 and its purpose is _not_ to be canonical path for a resource.
That said, I guess shortURL keys CAN be used for aliases as well. Not sure what the use-case is, but definitely a possibility. Either way exposing key as a token and making it available for pathauto is an interesting thought that I would like to look into when I get a chance. It needs some thinking though, because a key can not be both a redirect and a token participating into a path-auto as a token. The two are not compatible. I am also not sure, right now, if it makes sense to be a token (part of the alias) or has to be alias per se.
Thank you
Comment #13
yngens commentedUse case is that it becomes possible for Drupal sites generate nodes with twitpic style addresses like, for example: http://twitpic.com/1zntfn
[ulr] token provided now for pathauto is really not very much useable, but if that token contained only shortened part of url without site address would be excellent.
Comment #14
irakli commentedGot it.
I think I may have an idea bout how this might be implemented... More about it later.
Thanks
Comment #15
yngens commentedThanks for positive reply. So will this request be implemented as a token for pathauto or it can be done without it?
Comment #16
yngens commentedI added the following lines to the module, which create a new token for pathauto. I am not sure if it is done the right way, but it serves the need of my sites for now. Thanks!
Comment #17
yngens commentedUnfortunately, the above code is inconsistent with the ShortURL generated for Shorten. I tried also:
Again with no success to produce the same Short URL with pathauto, which used by Shorten module. And they have to be the same.
Comment #18
icecreamyou commentedEven if you were able to get a token working -- and the correct code to get the short URL token, by the way, is
shorturl_shorten(url('node/'. $data->nid, array('absolute' => TRUE, 'alias' => variable_get('shorten_use_alias', 1))))-- I think ShortURL would redirect it. Users wouldn't see the short URL in the URL bar.Comment #19
yngens commentedYou are right. The best way in my situation would go using [nid] in pathauto, but [nid] gives only numbers and I would like to combinate numbers with letters. Probably there is need for another module, which would provide short url token for pathauto without redirecting.
Comment #20
icecreamyou commentedAnother option would be like
p/[short]. It would add 2 characters to your URL but you would still be able to use the token without redirection. Or you could exclude the "p" character from ShortURL tokens and just usep[short].Comment #21
yngens commentedThe above code with your correction:
works just fine without any additional letters. But the problem is it gives different url than Shorturl provides for other modules like Shorten. Of course it does, because, as I understood, it takes URL from the address bar and generates Short URL, so what I want just is not achievable.
Comment #22
icecreamyou commentedOh. Well you could look it up. The ShortURL tokens have to be stored somewhere in the database.
Anyway, not my area. Irakli would know more.
Comment #23
locomo commentedsubscribe
Comment #24
yngens commentedWould be nice if only actual clean address of the node (like node/[nid]) and not any of its aliases would be shortened.
Comment #25
summit commentedHi,
Would love to have this on D7. Any progress in this field please?
greetings, Martijn
Comment #26
mably commentedThis issue was filed against the previous Drupal 6/7 module that used this project namespace.
The namespace has been taken over and the module has been replaced by a completely new and unrelated project for Drupal 10/11.
The original code remains available in the 6.x-1.x branch.
Closing this issue as it no longer applies to the current module.