Using mod_rewrite for a Virtual Filesystem vs. Real Filesystem
Posted
by
philtune
on Programmers
See other posts from Programmers
or by philtune
Published on 2012-06-30T13:16:34Z
Indexed on
2012/06/30
15:24 UTC
Read the original article
Hit count: 170
I started working in a department that uses a CMS in which the entire "filesystem" is like this:
- create a named file or folder - this file is given a unique node (ex. 2345) as well as a default "filename" (ex.
/WelcomeToOurProductsPage
) and apply a template - assign one or more aliases to the file for a URL redirect (ex.
/home-page-products
- can also be accessed by/home-page-products.aspx
) - A new Rewrite command is written on the .htaccess file for each and every alias
- Server accesses either
/WelcomeToOurProductsPage
or/home-page-products
and redirects to something like/template.aspx?tmp=2&node=2345
(here I'm guessing what it does - I only have front-end access for now - but I have enough clues to strongly assume) - Node 2345 grabs content stored in a SQL Db and applies it to the template.
Note: There are no actual files being created on the filesystem. It's entirely virtual. This is probably a very common thing, but since I have never run across this kind of system before two months ago, I wanted to explain it in case it isn't common. I'm not a fan at all of ASP or closed-sourced systems, so it may be that this is common practice for ASP developers.
My question, that has taken far too long to ask, is: what are the benefits of this kind of system, as opposed to creating an actual file hierarchy? Are there any drawbacks to having every single file server call redirected? To having the .htaccess file hold rewrite rules for every single alias?
© Programmers or respective owner