April 17th, 2000, 03:39 PM
I was fascinated by a scheme for presenting structured, low-maintenance websites over at Webmonkey
I'm working on my own variant, but I can't seem to get the most basic setup working. I want to hijack the url and pass it to the main script, where it is split on '/' and fed into an array. In the webmonkey article, they do this with an XSSI virtual include.
This doesn't seem to work under IIS. Is this because of the way IIS implements SSI, because I can't get a UNIX-style symbolic link under WinNT, or something else entirely. All I get from the SSI include is 'error processing SSI file /meta/structure.phtml'. A PHP include doesn't give me the URL I'm looking for. NT is not my primary platform, so I may be missing something obvious here. Any clues would be *greatly* appreciated!
Many thanks in advance-
April 17th, 2000, 07:29 PM
No need to use an SSI to do this. If you are using php just do this (assuming $url contains the URL to be parsed):
Which will place the elements of the URL into the array $url_array, split on the /.
April 18th, 2000, 10:20 AM
I'm sorry, I don't think I expained my problem clearly enough. Loading the URL into an array isn't the problem. $url_array=(split("/",$url)); works just fine in the original script. The problem remains that the URL the user goes to doesn't get 'hijacked' to point at the one script in the /meta directory that runs the whole site.
*Every* URL in the domain should pass through this one script, or I have to include() the script in every page, which adds maintenance that I was trying to get rid of in the first place. The way they had it set up was to have "index.html" (the default home page) set as a symbolic link to the actual home page (e.g. widgets.html) where "widgets.html" does nothing but an XSSI include of "/meta/structure.phtml". So if you go to, say, "http://widgets.com/widgets/blue/" and you do $url=PATH_INFO; from the script, since /widgets is really "widgets.html" $url will be set to "/blue/"
The webmonkey article explains this a lot better that I am here.
April 18th, 2000, 11:27 AM
The only way I know of to do what you are asking is thru Apache mod_rewrite.
There's an article on using that at www.phpbuilder.com
April 18th, 2000, 12:40 PM
Thank you for your note, but...
If I were using Apache, I wouldn't have this problem. After getting their servers hacked down to the BIOS several times, our web host moved our site over to IIS, which they felt they could keep more secure than the Linux server.
April 18th, 2000, 01:40 PM
LOL. If they can't keep Apache/Linux secure, I shudder to think what will happen under NT/IIS.
I'd recommend finding a different provider.