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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.