RE: [PHP] wildcard redirecting

From: Date: Thu, 30 Aug 2001 03:56:04 +0000
Subject: RE: [PHP] wildcard redirecting
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-65157@lists.php.net to get a copy of this message
>As I believe I mentioned before, I use PHP and MySQL to keep a >>>>journal. >all the entries are accessed by /index.phtml?id=23 , where "23" is >replaced by the id of the entry you want. >A "problem" I'm having is that some search engines' spiders (google, >>most >notably), won't navigate through all the different ?id= variants, even >though they are all linked together. There is a really simple solution. Replace /index.phtml?id=23 with /index/23 and use the following line of code in your index file: $path_array = explode('/', $REQUEST_URI); Apache will find index.phtml if it is in your directory index configuration line and get that file. The line of code I gave you will split the uri up so you can specify $id=$path_array[2]; and retrieve your file that way. If index.phtml is not in your directory index line then you must tell apache to treat any occurance of index in your url as a file with a .htaccess file. Fore more info see this: http://phpbuilder.com/columns/tim20000526.php3 Brett

« previous php.general (#65157) next »