Re: Quick q, most prolly 0T

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ryan A wrote:
Hey,

On 6/2/2005 5:17:47 AM, Richard Lynch (ceo@xxxxxxxxx) wrote:

URL re-writing can do that -- It ends up using his 'index' file (or
whatever) but you don't see it in the URL.


Thanks for replying.

But if I want to copy his exact way of doing things...instead of index file
I would like to
use main.php....how would i do that?
The reason I dont think its url rewriting is the rest of the files have all

AFAIK there is no definite way to tell what he is doing behind the scenes.

their values
eg:
somesite.com/?blah=blah
somesite.com/?something=something&do=1
somesite.com/?page=intro&flash=no

you can do the rewrite trick in php.

make sure everything goes via the index. (easy)
make sure 404's are handled by your index. (use .htaccess)

if you have a '404' first parse the complete request
to determine if you have some content to show based on
what every you found in the request, if you do then make the
404 handler spit out a 200 Status header along
with what ever output you have for the user -- other you have a
real 404 to deal with.


I have used such a schema to allow a user to define in a DB
what 'nice URLs' should link to particular articles etc.

e.g. the real URL is http://example.com/arts/article.php?id=345&bar=foo

the DB is configured to match:
http://example.com/arts/article.php?id=345&bar=foo
with
http://example.com/urlrewritten.html
(I have it so that the URL query params in the 'real URL' are
parsed and initialized before the real file [arts/article.php] is included)


My php 404 handler sees the user requested 'http://example.com/urlrewritten.html'
finds the match in the DB, loads the relevant GET args and includes/runs the
script..... thew backend might be hacky-as-**** but in terms of SEO it really works well!
(and it beats trying to teach my dad to SSH into a webserver and
edit a .htaccess full of rewrite engine declarations! :-)


etc

Thanks,
Ryan




On Wed, June 1, 2005 7:25 pm, Ryan A said:

Hey,
I noticed a site that is using php, but he is has shortened the url so
that
the filename was not shown..
eg:
somesite.com/?a=1

How did they do that? if it was url rewriting it would be

somesite.com/1/

so
what is he using?

Thanks,
Ryan



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.4.0 - Release Date: 6/1/2005

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Like Music?
http://l-i-e.com/artists.htm





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux