Monday, April 19, 2010

Drupal 6 Shortened URL to Files Directory

We recently had a situation where a client wanted shorter URLs since they were sending out emails and e-newsletters to clients and wanted things shortened up. Since Drupal 6 requires that uploaded files have the entire path it is obvious how that can be an eyesore for some people.

Current URL:
http://{domain}/sites/{domain or alias}/files/{file}.{extension}

A workaround is to go to the file system on the Drupal directory (/usr/share/drupal6) and create a symbolic link to the directory.

user@machine /usr/share/drupal6> ln -s /sites/{domain or alias}/files/{file}.{extension} {short-alias}

Example:
user@machine /usr/share/drupal6> ln -s /sites/blogger.com/files/ mbf

So the new URL becomes:
http://{domain}/mbf/{file}.{extension}

This Week's Offender - LongTail Video

We will be starting a new installment to help people understand the websites bombarding users with spam. It may not be published every week but we thought the title was catchy. For a little background it is possible to isolate a specific website because we use a service which generates a unique email address for each site we sign up for. We use this service when signing up for e-updates, e-newsletters, accounts, etc.

Website Name:
LongTail Video

Website URL:
http://www.longtailvideo.com/

Approx Spams per week:
15

Good day