Mark and Jill exceeded my expectations. I'm fairly new to Drupal and the project I'm working on for my largest customer needed some theme help, code modification, and data entry. Mark and Jill took care of it in short order.
file management
Adding an .htaccess Rule to Make Simpler Links to Drupal Files
In a site I was recently working on, I found myself hard-coding links to files stored within my Drupal site's "files" directory. If you've ever coded these links before, you know that they normally look something like:
/sites/[sitename]/files/[someotherdirectory]/image.jpg
This can be somewhat painful to add to the site, especially if you have any plans to ever change the domain name of your site. It would really be ideal if you could leave the domain name out of the equation and just write the link in the format:
/files/[someotherdirectory]/image.jpg
This is actually possible to do using the .htaccess file that appears in the root of your Drupal installation. Basically you just need to add a single line:
RewriteRule ^files/(.*)$ /sites/%{HTTP_HOST}/files/$1 [L]
After you implement this rule, you should be able to start writing simpler links to your "files" directory.
Happy coding!




