PHP Classes
Icontem

Subject: More About PHPClasses site


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend!

      PHP Classes blog   More defensive progra...   All threads   More About PHPClasses site   (Un) Subscribe thread alerts  
Subject:More About PHPClasses site
Summary:Some questions about PHPClasses
Messages:7
Author:Cesar D. Rodas
Date:2007-06-07 18:20:10
Update:2008-11-09 18:56:19
 

  1. More About PHPClasses site   Reply  
Picture of Cesar D. Rodas
Cesar D. Rodas
2007-06-07 21:51:19
Hello Mr. Lemos.

Great article. I think this is very important because the theory is a quite different from practice.

Right now I have some questions about your site mr. Lemos, and will be great if you can clean my doubts.

*http://www.phpclasses.org/dnserver
How do you manage this kind of redirections? with URL rewrites?.

* When you download some package I saw that the URL are like theses:
http://www.phpclasses.org/browse/download/targz/package/3736/name/dnserver-2007-03-07.tar.gz
http://www.phpclasses.org/browse/download/zip/package/3736/name/dnserver-2007-03-07.zip

In the URls, are they real files, I mean are they really exist in the FS. example:
/var/www/html/browse/download/zip/package/3736/name/dnserver-2007-03-07.zip
Or are you using URL Rewrite redirecting to other location on FS
Or are you generating the file in real time with php (I think this is very bad for performance).

Resuming my big question is if you use or not URL rewrite?. Because I think the way of PHPClasses manage namespaces made it easy to crawl and easy of replicate.

Thank you.

Cesar D. Rodas

PD: Sorry if I have mistakes with my "English" in this post ;)

  2. Re: More About PHPClasses site   Reply  
Picture of Manuel Lemos
Manuel Lemos
2007-06-07 22:01:04
The site uses Apache ErrorDocument to handle requests to pages that do not exist.

There is no page http://www.phpclasses.org/dnserver . The error handling script handles that request. It analyzes the REQUEST_URI environment variable and figures what page you want to access.

The site does not use mod_rewrite anywhere. Requests to URL like http://www.phpclasses.org/browse/download/targz/package/3736/name/dnserver-2007-03-07.tar.gz are handled by a PHP script named browse .

Apache is configured to treat the browse script as a PHP script. It analyzes the REQUEST_URI to extract parameters that determine the content that is going to be served.

  3. Re: More About PHPClasses site   Reply  
Picture of Wojciech
Wojciech
2008-11-05 15:57:30
I just tought about doing the same thing for SEO friendly urls on the website Im doing, however I was wondering how bots will see this. When you use ErrorDocument 404 doesnt it mean the result will be 404 whatever the content is served ?

cheers

  4. Re: More About PHPClasses site   Reply  
Picture of Manuel Lemos
Manuel Lemos
2008-11-05 17:54:37
No, the script that handles the error page request determines the status code. So robots always see it as a normal page.

Anyway, if you have a PHP script named browse and configure Apache to treat it as PHP script like in the PHPClasses, requests to /browse/package/N.html will always be handled by browse script, not as a 404 error .

  5. Re: More About PHPClasses site   Reply  
Picture of Wojciech
Wojciech
2008-11-05 21:33:59
thanks for your reply but Ive had so many problems with that hosting that its hard to say. Not only is rewrite engine disable and many php functions but I noticed that whatever I do it does result in 404 error using this method.

Ihave used index.php for my standard page and 404 handler. using header( location ... I tested header function to work and it did. But whenever script is used as 404 handler header function does not work so changing to 200 code is not possible there whatever you do - result : frendly urls with 404 respone :)

Had to change my system all way through.

People be aware of demon.net if you want to have friendly urls.

  6. Re: More About PHPClasses site   Reply  
Picture of zsolt szabo
zsolt szabo
2008-11-09 18:47:50
Hi

First thank you for the excellent class.
I have one question ( well I am a graphic designer not a php guru )

Is it possible to get this class work withoult mod_rewrite?

This link:
index.php?page=about_us

to:
index.php/page/about_us

I fiddled a lot around but I could not get it to work.

The best thing I did was:
index.php/page/about_us

but after I clicket an another button my url was the following:
index.php/page/about_us/page/about_us/

if I clicked on another button:
index.php/page/about_us/page/about_us/page/about_us/page/about_us/

etc

CA you help me to get such a functionality ?

Thanks
Zsolt








  7. Re: More About PHPClasses site   Reply  
Picture of Manuel Lemos
Manuel Lemos
2008-11-09 18:56:19
You need to study Apache mod_rewrite configuration, which is something not really related with PHP.

Anyway, you do not need to rewrite URLs to make sites handle high traffic loads.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products