[thelist] 404s and URL strings, oh my!

Philippe J philippejadin2 at swing.be
Thu Feb 1 16:32:36 CST 2001

> /dir/dir2/index.html where 'dir' and 'dir2' were actually URL variables
> that you needed to have parsed. if i'm following you correctly, you're
> saying, "why not just send /index.html?var1=dir&var2=dir2 " to apache,
> let mod_rewrite take that and process it as /dir/dir2/index.html and
> pass it to cold fusion for processing?" (if thats not what you meant,
> sorry :)

I'm not too sure, but wouldn't it be the exact oposite that would be
interesting to do?
I mean, having a search engine friendly url, and in the same time have some
way to access the values of the "virtual url" we just linked to?

>From the book "Web application Development with php4" (Tobias Ratschiller &
Till Gerken), there are differents ways to avoid a final query string
(index.?id=5...). Those technics were not intended for this use, but those
were smart enough to be shared.

1. it seems that when you call for the file
"www.yoursite.com/index.php/somevar/anothervar/" ...  The server will see
that the index file is php, and will stop looking further in the url. Those
are just plain fake directories, and those can be accessed in php with
$REQUEST_URI . This seems to be the easiest way. Problem, it doesn't work
here on my dumb win32+apache. Have no idea of the behavior of coldfusion
with this. I'm not too sure if it depends of the webserver, the os, or the
scripting tool.

2. use mod_rewrite with an url like this :
A well written url rewritting rule should do the job nicely, and send the
arguments to the php file which is in fact located at
www.yoursite.com/index.php . Didn't try this yet.

3. They also speak about the so called "dns trick", but it seems quite
complex to implement. Basically, your url would look like :
http://yourvar.yoursite.com . Didn't understood, will not try this a thome.

There are plenty of tricks to avoid parameters in url. Let's hope we won't
need those hacks too long, as search engines will become more
developper-friendly ;-)


More information about the thelist mailing list