如何使用 php 实现对 SEO 友好的 URL? [英] How can I implement SEO-friendly URL with php?

查看:28
本文介绍了如何使用 php 实现对 SEO 友好的 URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用 Apache HTTP + PHP + MongoDB.

I'm currently using Apache HTTP + PHP + MongoDB.

我正在尝试实现对 SEO 友好的类似stackoverflow"的 url.

I'm trying to implement "stackoverflow"-like url which is SEO friendly.

我是否应该阅读每篇文章的标题,然后以某种方式将其发送给 Apache?如果是这样,我该怎么做?

Should I read a title from each article and somehow send that to Apache? If so, how can I do that?

这样 Apache 就可以使用 mod_rewrite 处理标题字符串并具有类似的 URL

So that Apache can handle that the title string with mod_rewrite and having URL like

www.example.com/123/seo-friendly-page 

用示例代码片段给我一些想法

Give me some ideas with an example snippet code

推荐答案

您可以在 .htaccess 的帮助下创建对 SEO 友好的 URL.网上有很多关于这个的教程......这里是一个 链接.

You can create SEO friendly URL's by the help of .htaccess. there is a lot of tutorial on the web about that.... here is a LINK.

如果你想使用 php 和 mysql 更安全......那么......链接

and if you want more secure with php and mysql..... then.....LINK

我认为这对你有帮助......

I think this is helpful for you....

这篇关于如何使用 php 实现对 SEO 友好的 URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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