Reply to Re: News-Site kind of url

Your name:

Reply:


Posted by Dikkie Dik on 12/15/05 01:59

I am not very familiar with Apache and htaccess options, but I think
some webservers can select a default (script) file by the directory,
even if more nonexisting subdirectories are given. You can then just
parse the REQUEST-URI to get the directory-style parameters.

Looking up a string is not that much trouble for a database. And there
are lots of possibilities to optimize it. The site could, for instance,
keep a relatively small table of "active" articles with name and ID. You
could look up the name in the small table quite fast, read the ID and
find the article by its ID from a much larger, more static, table.
On the other hand, special keywords like "latest news" could well be
filtered out in PHP and result in a query that requests articles sorted
by date.
It would not even be that hard to drive the entire article selection on
the news site by using just dates and categories. If your categories are
fixed, you could store them in some included PHP file instead of your
database if you really wanted to. But a categories table isn't that
large anyway, so there would be no need.

frizzle wrote:
> Hi Group,
>
> I'm builiding a sort of a news-site, with a mySQL backend.
> Nowadays, i come across a lot of news-pages with the
> title of the article in the URL. For example this one:
> http://www.nieuwnieuws.nl/ (dutch in this case)
>
> Anyway, every article seems to have it's own html-page.
> I know that the page in my example actually has php-pages and
> a mysql-db.
>
> In my own site, i use htaccess to simulate directories and everything,
> but what i wonder is how THIS system works.
> If site.com/news/hot_news.html is converted to
> site.com/news.php?article=hot_news,
> Does this mean that the PHP looks in the DB "WHERE article =
> 'hot_news'" ?
> Meaning it looks for a piece of text instead of an actual id?
>
> Wouldn't it mean the queries would be extremely slow?
>
> I hope my question is clear, since i don't exactly know how to explain.
>
> Thanks, Frizzle.
>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация