Re: [SMARTY] search engine friendly urls php/b/2 not php.php?b=2

From: Date: Mon, 27 Oct 2003 21:41:52 +0000
Subject: Re: [SMARTY] search engine friendly urls php/b/2 not php.php?b=2
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10444@lists.php.net to get a copy of this message
Andras Kende wrote:
Hello All, I looking for earch engine friendly code for smarty Where urls like php/b/2 not php.php?b=2 I have a this php code, cant get to work... if(isset($PATH_INFO)) { $vardata = explode('/', $PATH_INFO);
       $num_param = count($vardata);        if($num_param % 2 == 0) {            $vardata[] = '';            $num_param++;        }        for($i = 1; $i < $num_param; $i += 2)
{
       $$vardata[$i] = $vardata[$i+1]; } }
Thanks, Andras Also - I've written a tutorial on the way you're looking to rewrite urls.. http://www.phpexamples.net/tutorial-6-1.html
its possible that you do not have the right settings in the vhosts file for apache(if you even have access to it)... are you sure that you are getting $PATH_INFO? Here are the things that need to be added to the virtualhost configuration.. <Files php> ForceType application/x-httpd-php </Files> <Directory /path/to/your/html/root/> AllowOverride Options FileInfo AcceptPathInfo On </Directory> <Files> alows you to force php to parse the set file.. the other key part is AcceptPathInfo if its not set to on, the it will not be passed to php by apache. Hope it helps, Rolf Bruslettto www.phpExamples.net

« previous php.smarty.general (#10444) next »