Re: [PHP] How to work with virtual (seo) URLs?



Hello Erik,

I just realized that I oversaw some things. Here they are:

Am Sonntag, 19. November 2006 00:05 schrieb Erik Gyepes:
#check if file or directory real exists:
is_dir()
file_exists()

#do the rule only if the address has no extension:
pathinfo()


#replace /whatever to /whatever/, not apply to whatever/!
preg_replace()
regex: "/[^/]$/"

#do the rule only if the address ends with trailing slash:
preg_match()
regex: "/\/$/"

#if the rule ends with trailing slash then redirect to index.php..
s.o.
header("Location: http://path/to/index.php\r\n";);

Regards,

Oliver
.