阿帕奇mod_rewrite的VS. PHP路由? [英] Apaches mod_rewrite VS. PHP routing?

查看:125
本文介绍了阿帕奇mod_rewrite的VS. PHP路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些日子,现在我一直在努力做一个简单的mod_rewrite规则创建友好的URL,我的虚拟主机已启用了mod_rewrite,但我不能得到它的工作。

for some days now I have been trying to make a simple mod_rewrite rule to create friendly URLs, my web host have mod_rewrite enabled but I just can't get it to work.

所有的地方张贴我的下一个问题:

All the next questions where posted by me:


  1. .htacces创建友好的URL

  2. 用的.htaccess友好的URL

  3. .htacces不工作...

  1. .htacces to create friendly URLs
  2. Friendly URLs with .htaccess
  3. .htacces NOT working…

问题的答案没有工作,所以我现在正在考虑使用简单的PHP路由,而不是,我想知道是否有在两者之间有很大的性能或SEO的区别。如果有,也许你知道如何解决张贴在我的问题mod_rewrite的问题。

None of the answers worked, so I'm thinking now using simple php routing instead and I wanted to know if there is a big performance or SEO difference between the two. And if there is, maybe you know how to fix the mod_rewrite problems posted in my questions.

感谢。

推荐答案

如果你使用PHP路由为仅PHP文件,这将是没有问题的表现明智的:内部preTER将得到反正开始,一新进​​程启动,内存分配等。

If you're using PHP routing for PHP files only, it would be no problem performance-wise: The interpreter will get started anyway, a new process started, memory allocated etc.

但是,如果你打算像图像和样式表的静态资源请求路由为好,但是,的的在任何情况下使用PHP的路由。它的方式太资源密集型的,而不是什么PHP是为建造。

But if you are planning to route requests for static resources like images and style sheets as well, however, don't use PHP routing under any circumstance. It's way too resource-intensive and not what PHP was built for.

我说的mod_rewrite 是更好的,更精简的解决方案,它是值得尝试弄明白。

I'd say mod_rewrite is the better, leaner solution and it's worth trying to figure it out.

这篇关于阿帕奇mod_rewrite的VS. PHP路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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