Page 1 of 1

Search Engine friendly urls

Posted: Wed Jun 11, 2003 10:45 am
by GHOLYOAK
Hi,

Just read an article about search engine friendly urls.
In a nut shell you replace

?name=value

with

index.php/name/value

and then you use $PATH_INFO to extract the stuff you want and as there is no '?' in it, apparently search engines are quite happy to trawl through it.

Anyway, thought I'd give it a go but my internal IIS server keeps giving me funny errors like :

Code: Select all

Warning: Unknown(D:\public_html\index.php\dev\same): failed to create stream: No such file or directory in Unknown on line 0

Code: Select all

Warning: Unknown(): Failed opening 'D:\public_html\index.php\dev\same' for inclusion (include_path='.;d:\includes') in Unknown on line 0
whilst the external (hosted) Apache/Linux server works !

Is it a IIS thing, an Apache thing or a php.ini thing (I cant get to the hosted php.ini file) ?

Any suggestions would be appreciated !

Whilst the article was quite informative, it didn't cover what would happen if PHPSESSIONID was encountered by the search engines ???????

Posted: Wed Jun 11, 2003 11:06 am
by cactus
Post a link to the Article, may be of interest to others.

Regards,

Posted: Wed Jun 11, 2003 11:12 am
by GHOLYOAK

Posted: Wed Jun 11, 2003 12:00 pm
by cactus
Can you post some code so we can see it in context, I guess it could be a Win32 thing but have little experience of PHP in that environment.

Anyone else ?

Regards,

Posted: Wed Jun 11, 2003 12:09 pm
by cactus
The original article, with comments:

http://www.zend.com/zend/spotlight/searchengine.php

:)

Regards,

Posted: Wed Jun 11, 2003 11:46 pm
by McGruff
One thing to note about pathinfo: it can get confused with "." if there are dots in a path - it thinks the dot means a filename extension even if it's a folder path.

Easy to fix if you define a couple of constants for your site say:

define('ACTUAL', 'forums.devnetwork.net');
define('TEMP', 'forumsdevnetwork.net');

.. then str_replace ACTUAL with TEMP in the path, run pathinfo on the processed path, and finally replace TEMP with ACTUAL in the pathinfo output array.