Jump to content

[SOLVED] $PATH_INFO and Search engine URL's... Not set.


AbydosGater

Recommended Posts

Hi, Ive been working on getting all the URL's on my site friendly for search engines.. as most of my site depends heavily on the GET method for articles and pages.. so Search engines like google only really get my index page..

So i was reading up on the PHP.nets article on path info and there is a good comment to the post that states this code:

 

if(isset($PATH_INFO)) {
      $viewcode = explode('/', $PATH_INFO);
        $num = count($viewcode);
        if($num % 2 == 0) {
            $viewcode[] = '';
            $num++;
        }
        for($i = 1; $i < $num; $i += 2) {

            $$viewcode[$i] = $viewcode[$i+1];

          }
    }

So i was hoping this would work, But its not working on my server... Its just like the $PATH_INFO is not set.. heh probs cause its not set. But i have read in many places that this should be auto set by apache?

 

Why is it not being set? Is there a config setting i missed or something?

 

Andy

Ah right. I had thought so but a few sites i saw said it was default set by apache.. in which case i was wondering why it wasnt in the server var.. but it doesnt seam to be..

 

How do sites that have Search engine friendly URLs get the data? Eg: site.com/news.php/article/somearticle .. instead of news.php?action=article&article=somearticle?

 

Thanks Andy

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.