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]
This is the hardest thing I've ever had to write, much less admit to myself. I've written resignation letters from jobs I've loved, I've ended relationships, I've failed at a host of tasks, and let myself down in my life. All of those feelings were very...
Firefox OS is all over the tech news and for good reason: Mozilla's finally given web developers the platform that they need to create apps the way they've been creating them for years -- with CSS, HTML, and JavaScript. Firefox OS has been rapidly improving...
SmoothScroll is a fantastic MooTools plugin but smooth scrolling only occurs when the anchor is on the same page. Making SmoothScroll work across pages is as easy as a few extra line of MooTools and a querystring variable.
The MooTools / PHP
Of course, this is a...
We all joke about the days of Web yesteryear. You remember them: stupid animated GIFs (flames and "coming soon" images, most notably), lame counters, guestbooks, applets, etc. Another "feature" we thought we had gotten rid of was the marquee. The marquee was a rudimentary, javascript-like...
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 !