Search Engine friendly urls

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GHOLYOAK
Forum Newbie
Posts: 7
Joined: Wed Apr 30, 2003 7:12 am

Search Engine friendly urls

Post 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 ???????
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

Post a link to the Article, may be of interest to others.

Regards,
GHOLYOAK
Forum Newbie
Posts: 7
Joined: Wed Apr 30, 2003 7:12 am

Post by GHOLYOAK »

User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post 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,
User avatar
cactus
Forum Regular
Posts: 343
Joined: Tue Jun 10, 2003 4:16 am
Location: UK

Post by cactus »

The original article, with comments:

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

:)

Regards,
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post 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.
Post Reply