[thelist] Directory style query strings without using mod_rewrite

Richard Livsey R.Livsey at cache-22.co.uk
Thu Jul 19 04:22:06 CDT 2001


> [mailto:thelist-admin at lists.evolt.org] On Behalf Of Garrett Coakley
> Sent: 18 July 2001 18:59
> To: thelist at lists.evolt.org
> 
> On Wed, 18 Jul 2001 16:43:44 +0100
> "Richard Livsey" <R.Livsey at cache-22.co.uk> wrote:
> 
> > Basically as the subject says, I want to mask query strings as 
> > directory style URL's but cant use mod_rewrite.
> > 
> > Does anyone know how this would be done?
> > Server is PHP/Apache.
> 
> 
> function processURI() {
> 	//explode the URI using '/' as a delimeter
> 	$array = explode("/",$REQUEST_URI);
> 	//which company division are we in?
> 	//we start at pos [2] cos [1] is site
> 	$loc = $array[2];
> 	//better check if we're at the root level of that 
> company or at a page
> 	$page = $array[3];
> 	// build the array
> 	$url_array = array(
> 			"location" => $loc, 
> 			"page" => $page
> 			);
> 	// return our array
> 	return $url_array ;
> }
>

Just a point with this - $REQUEST_URI shouldnt be available in the
function. You will have to make it global in order to use it inside of
the function.
(global $REQUEST_URI)

Apart from that it works like a charm, cheers.
 
> 
> There's an article on phpbuilder.com which outlines a method 
> similar to this, I'm not online right now, but if you have a 
> look in the Articles section, you should see it.

Cheers - hadnt seen it as it was under the title of making your site
search engine friendly!

R.Livsey
Lead Programmer for the Tickle Group
Freelance work always welcome
[ PHP | Perl | mySQL | Java ]
work  : www.tickle.co.uk
personal : www.cache-22.co.uk
e : R.Livsey at cache-22.co.uk
m : +447764 685 701
i : 37530949
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.264 / Virus Database: 136 - Release Date: 02/07/2001






More information about the thelist mailing list