Nathan Lane wrote:
Thank you all - this will definitely get me started.

On Tue, Apr 22, 2008 at 9:47 AM, Orson Jones <[EMAIL PROTECTED]>
wrote:

Nathan Lane wrote:

I guess I just want to make my query strings more SEO compatible. I've
seen
a couple of MVC frameworks do this, like cakePHP - of course I guess
because
it is an MVC system, maybe it makes more sense. It writes the url as
page.php/controller/function or something like that when you request it.
Is
this making any sense? Has anybody besides me heard of URL rewriting?

It isn't too hard. I built some functions that strip the relevant data
out of $_SERVER. Mine were specific to a project, but looking through
the output of the following script and trying out several urls will give
you an idea of what to pull out.

<pre>
$_SERVER[]
<?php print_r($_SERVER); ?>
</pre>

The relevant ones seem to be SCRIPT_FILENAME, SCRIPT_NAME and REQUEST_URI

Orson


There are two steps: first writing "clean" urls - as mentioned above mod_rewrite in ".htaccess" is what you want. Then you need a main controller that parses the clean url to put the pieces into controller, action, and id variables. Actually it's pretty simple code - but since I've switched over to python and ruby I don't remember the exact code I used but you can search on "clean urls" or "front end controllers" and there's several how-to articles on this - that's how I found it. If you're really stuck let me know and I'll dig out the code I used.
_______________________________________________

UPHPU mailing list
[email protected]
http://uphpu.org/mailman/listinfo/uphpu
IRC: #uphpu on irc.freenode.net

Reply via email to