新闻 - 网站类型的网址 [英] News-Site kind of url

查看:57
本文介绍了新闻 - 网站类型的网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Group,


我正在建立一个带有mySQL后端的新闻网站。

如今,我遇到了一个很多新闻页面都带有URL中文章的

标题。例如:
http://www.nieuwnieuws.nl/ (荷兰语在这种情况下)


无论如何,每篇文章似乎都有它自己的html页面。

我知道我的例子中的页面实际上有php-pages和

a mysql-db。

在我自己的网站上,我使用htaccess来模拟目录和一切,

但我想知道这个系统是如何工作的。

如果site.com/news/hot_news.html转换为

site.com/news.php?article = hot_news,

这是否意味着PHP在数据库中查找WHERE article =

''hot_news''" ?

意味着它要查找一段文本而不是实际ID?


这不是说查询会非常慢吗? />

我希望我的问题很明确,因为我不知道如何解释。


谢谢,Frizzle。

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.

推荐答案

frizzle写道:
frizzle wrote:
嗨组,

我是使用mySQL后端构建一个新闻站点。
现在,我遇到了许多新闻页面,其中包含URL中文章的
标题。例如:
http://www.nieuwnieuws.nl/ (荷兰人在这种情况下)


Geeft niks。 Mooie taal。

无论如何,每篇文章似乎都有它自己的html页面。
我知道我的例子中的页面实际上有php页面和
a mysql-db。

在我自己的网站中,我使用htaccess来模拟目录和一切,
但我想知道这个系统是如何工作的。
如果是site.com/news /hot_news.html转换为
site.com/news.php?article=hot_news,


可能是的。

这是否意味着PHP查看数据库WHERE article =
'hot_news''" ?


也许。很难说。

也许hot_news是特别的东西,比如文章的集合。


意思是它寻找一段文字而不是实际的id ?


我同意。一个好的databasedesigner / webappbuilder会尽可能避免全文

substringsearch。

但是接收脚本可能会检查特殊情况,比如''hot_news''和

将做出相应的回应。


例如:如果它是一个整数:得到文章,如果它是一个特殊的

字符串,做其他事情。


这不是意味着查询会非常慢吗?

我希望我的问题很清楚,因为我不知道如何解释。

谢谢,Frizzle。
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)

Geeft niks. Mooie taal.
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,
Probably yes.
Does this mean that the PHP looks in the DB "WHERE article =
''hot_news''" ?
Maybe. Hard to say.
Maybe the hot_news is something special, like a collection of articles.

Meaning it looks for a piece of text instead of an actual id?
I agree. A good databasedesigner/webappbuilder would avoid full text
substringsearch wherever possible.
But maybe the receiving script checks for special cases like ''hot_news'' and
will respond accordingly.

For example: If it is an integer: get the article, if it is a special
string, do something else.


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.




google for mod_rewrite

我希望这样的模块支持它。


问候,

Erwin Moller



google for mod_rewrite
I expect such a module is behind it.

Regards,
Erwin Moller


" frizzle" < pH值******** @ gmail.com>写道:
"frizzle" <ph********@gmail.com> writes:
Hi Group,

我正在建立一个带有mySQL后端的新闻网站。
现在,我遇到很多新闻页面,其中包含URL中文章的标题。例如:
http://www.nieuwnieuws.nl/ (荷兰语在这种情况下)

无论如何,每篇文章似乎都有它自己的html页面。
我知道我的例子中的页面实际上有php-pages和
在我自己的网站中,我使用htaccess来模拟目录和所有内容,
但我想知道这个系统是如何工作的。
如果是网站。 com / news / hot_news.html转换为
site.com/news.php?article=hot_news,
这是否意味着PHP在数据库中查找WHERE article =
'hot_news''" ?
意味着它会查找一段文本而不是实际的ID?

这不是意味着查询会非常慢吗?
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?




也可能是这样的:


switch(



could also be something like:

switch (


_GET [" article]){

case" hot_news":

//做东西

休息;

}


如果你看到了我的观点。我同意使用id不是最好的文本,但是他们也可以使用

artucle类型表进行某种加入,例如:


从文章,article_types中选择*



其中article_types.type_name =''hot_news''

和articles.type = article_types.type

-

Henrik Hansen
_GET["article"]) {
case "hot_news":
//do stuff
break;
}

if you see my point. I agree using text for the id is not the best
thing to to, but they could also be doing somekind of join with a
artucle type table like:

select *
from articles, article_types
where article_types.type_name = ''hot_news''
and articles.type = article_types.type

--
Henrik Hansen


这篇关于新闻 - 网站类型的网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆