RE: [SMARTY] search engine friendly urls php/b/2 not php.php?b=2
| From: | Andras Kende | Date: | Tue, 28 Oct 2003 00:21:04 +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-10446@lists.php.net to get a copy of this message | ||
Richard,
Thanks, I found the php version of s.e. friendly simpler in my case..
This few line of code works great now:
$uriparams = explode("/",$REQUEST_URI);
if( $uriparams[1] == 'main' ) $sort = $uriparams[2];
if( $uriparams[1] == 'bank' ) $bank = $uriparams[2];
...
...
look:
http://www.creditapply.net
Andras
-----Original Message-----
From: Richard Jones [mailto:rj@last.fm]
Sent: Monday, October 27, 2003 5:14 PM
To: smarty-general@lists.php.net
Subject: Re: [SMARTY] search engine friendly urls php/b/2 not php.php?b=2
I suggest you check out apache mod_rewrite
it's a *much* nicer solution than writing crazy php scripts that chop up the
url :)
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=mod_rewrite&btnG=Goog
le+Search
On Monday 27 October 2003 9:41 pm, Rolf Brusletto wrote:
> 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
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php