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]
![Create a CSS Flipping Animation]()
CSS animations are a lot of fun; the beauty of them is that through many simple properties, you can create anything from an elegant fade in to a WTF-Pixar-would-be-proud effect. One CSS effect somewhere in between is the CSS flip effect, whereby there's...
![Regular Expressions for the Rest of Us]()
Sooner or later you'll run across a regular expression. With their cryptic syntax, confusing documentation and massive learning curve, most developers settle for copying and pasting them from StackOverflow and hoping they work. But what if you could decode regular expressions and harness their power? In...
![Save Text Size Preference Using MooTools 1.2]()
Last time posting here I taught you how to change text-size with JavaScript. The problem with using the solution I presented as Ian Lloyd pointed out:
Increase the font size, follow a link to another web page on same site and … back...
![background-size Matters]()
It's something that makes all men live in fear, and are often uncertain of. It's never spoken, but the curiosity is always there. Nine out of ten women agree in the affirmative. Advertisers do their best to make us feel inadequate but...
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 !