[nycphp-talk] Friendly URLS... The easy way!
Marc Antony Vose
suzerain at suzerain.com
Mon Aug 6 23:47:01 EDT 2007
I've noticed a lot of web sites using this technique. I know this
stuff always changes, but one potential caveat: the last I knew,
search engines were either ignoring or ranking down anything after
the xxxx.php in the URL when people use this structure.
is not as good as
from Google's point of view.
So, easier, yes, but it might give you some unwanted side effects.
Again, this information might have changed, or even might have been
wrong in the first place, but since mod_rewrite is so dead simple to
use, IMO it's not worth the risk.
Maybe someone else can either clarify or refute my claim.
Le 7 août 07 à 09:19, Paul Houle a écrit :
> There's an easy way to get 'friendly' URLs in PHP. There are two
> tricks involved:
> (1) It seems to be a bit obscure that if you have a PHP script at
> the same script is called if you visit
> Try it! You can make your script display something different based
> on the path
> you enter by checking the superglobal $_SERVER["PATH_INFO"]. From
> if-then-else ladders to advanced frameworks, you can take it from
> there as you wish.
> (2) You can remove the ".php" from your scripts by putting the
> following in your
> .htaccess or apache configuration:
> DefaultType application/x-httpd-php
> Now if you have a script without an extension (say, "myscript")
> you can write
> New York PHP Community Talk Mailing List
> NYPHPCon 2006 Presentations Online
> Show Your Participation in New York PHP
More information about the talk