To ease integration of ShURLy into a full Drupal site, would it be possible to configure a root for all short URLS?

I'm thinking something like http://example.com/go/XYZ

Comments

jjeff’s picture

But if you add a root URL, then the short URLs would be less short! ;-)

ShURLy short URLs *should* do a good job of trying not to conflict with any existing paths or path aliases on your site - for instance, users can't create custom short URLs like "node" or "user". They also can't create short URLs with "/" in them. So even if a user did create a short url of "og" and you later tried to enable Organic Groups module, the worst you'd have to do would be to delete one short URL.

I can understand why you might want to have the safety of a root URL for the short URLs, but for performance reasons ShURLy does its business in hook_init() so that it doesn't incur a full drupal bootstrap. Additionally, it does some quick validation to see if the incoming URL could even be a valid short URL. Part of this validation is checking to see if there's a "/" in the URL. If there is, then ShURLy doesn't even do a database lookup. It makes for great performance, but it does also make things a bit more rigid.

Can you explain more about your use case? Perhaps there's a better way to solve the problem you're having.

jorgeegomez’s picture

Status: Active » Closed (works as designed)

Jeff,

I understand the trade-off in favor of the quick validation. Having a short prefix (such as /go/) wouldn't lengthen the URL too much and make for a better-organized path system (I have this in mind for intranet use), but I think the design of the module cleverly prevents this by avoiding the full drupal load.

And as you point out, the ideal use case for ShURLy is on a domain of its own, which could be useful even in an internal case.

picxelplay’s picture

I think it would be an asset to add /go/ (or similar) to the prefix of a ShURLy url. This would be handy for cloaking affiliate links, just like the many go.php scripts out there.

picxelplay’s picture

Status: Closed (works as designed) » Active
funature’s picture

Version: 6.x-1.0-rc1 » 7.x-1.x-dev

i'd like to have this feature too, or could somebody provide a patch for the people who needs this feature?

jibus’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

I guess the project Gotwo (https://drupal.org/project/gotwo) is more appropriate for this.