AbydosGater Posted July 18, 2007 Share Posted July 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
lightningstrike Posted July 18, 2007 Share Posted July 18, 2007 Umm $PATH_INFO is just a local scope variable. You need to define it yourself using the pathinfo() function. e.g. $PATH_INFO = pathinfo("/path/to/files/"); Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 18, 2007 Author Share Posted July 18, 2007 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 Quote Link to comment Share on other sites More sharing options...
AbydosGater Posted July 18, 2007 Author Share Posted July 18, 2007 Ah its ok, Im going to take a crack at mod_rewrite.. [solved] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.