Organized, Short Folder Structure Using mod_rewrite
I tend to be over-organized when I create the folder structure of my customers' websites. I like using descriptive file and folder names for a number of reasons:
- Search engine friendly URLS and image names (for image searches)
- Descriptive file names give users a "preview" of the linked page in the status bar (if the anchor text isn't descriptive enough or the link is an image)
- I want to be able to tell what a file is when I see the file name
One problem with my method is that long folder names can be annoying to type and can bloat your pages resulting in ugly load times. I use the power of mod_rewrite to shorten paths to files I reference most, image files.
The XHTML
becomes...
The mod_rewrite .htaccess
RewriteEngine On
RewriteRule ^gis/(.*)$ /graphics/icons/small/$1 [L]
Back in late 2012 it was not easy to find open source projects using requestAnimationFrame()
- this is the hook that allows Javascript code to synchronize with a web browser's native paint loop. Animations using this method can run at 60 fps and deliver fantastic...
When you say or read "HTML5", you half expect exotic dancers and unicorns to walk into the room to the tune of "I'm Sexy and I Know It." Can you blame us though? We watched the fundamental APIs stagnate for so long that a basic feature...
David asked me if I'd be up for a guest post picking out some of my favorite Pens from CodePen. A daunting task! There are so many! I managed to pick a few though that have blown me away over the past few months. If you...
One of the plugins I'm most proud of is Dotter. Dotter allows you to create the typical "Loading..." text without using animated images. I'm often asked what a sample usage of Dotter would be; form submission create the perfect situation. The following...
Very slick :)
Okay very interesting. How would that apply if your directory structure was set out like this?
/nr/rdonlyres/2069656a-f68e-4563-b9a5-4b9a9922f7a4/0/transferform0809.pdf
/nr/rdonlyres/86e6a9ab-1633-4e4b-8790-bff74df03487/0/lamslistpublishedweb11november08.pdf
As you can see the 3rd subfolder changes and could be anything.
What if I wanted it to look like.
/attachment/filename.pdf
Using the method you mentioned how would it work?
Cheers
zeroanarchy
hahaha melllttttttttt , no one likes you !