pretty的网址没有mod_rewrite的,没有的.htaccess [英] Pretty URLs without mod_rewrite, without .htaccess

查看:246
本文介绍了pretty的网址没有mod_rewrite的,没有的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果没有可能访问的.htaccess我发现自己在一个创造性的僵局。 没有mod_rewriting我不过,我希望能够做的很好的东西,如:

Without a possibility to access .htaccess I find myself in a creative impasse. There is no mod_rewriting for me. Nevertheless, I want to be able to do the nice stuff like:

http://www.example.com/Blog/2009/12/10/
http://www.example.com/Title_Of_This_Page

我有什么办法?

在对答案的:

  • 在我建设有PHP5
  • 在我用不上为.htaccess
  • http://www.example.com/index.php/Blog/ 是公知的技术,但我并不preFER它。是显示了PHP这么说。
  • 我将如何创建无扩展名的PHP文件?这会做的伎俩?
  • 多少钱使用自定义的404技术受伤的性能?
  • I'm building with php5
  • I don't have access to .htaccess
  • http://www.example.com/index.php/Blog/ is a known technique but I don't prefer it. Is shows the php so to say.
  • How would I create extensionless PHP-files? Would this do the trick?
  • How much would using the custom 404 technique hurt performance?

推荐答案

如果你已经设置为你的服务器,你可以用它来重定向请求404自定义错误文档的权限。

If you've the permissions to set custom error documents for your server you could use this to redirect 404 requests.

例如。为Apache(<一href="http://httpd.apache.org/docs/2.0/mod/core.html#errordocument">http://httpd.apache.org/docs/2.0/mod/core.html#errordocument)

E.g. for Apache (http://httpd.apache.org/docs/2.0/mod/core.html#errordocument)

ErrorDocument 404 /index.php

在index.php然后,可以通过使用从$ _ SERVER数组中的数据进行您的要求。

In the index.php you then can proceed your request by using data from the $_SERVER array.

这篇关于pretty的网址没有mod_rewrite的,没有的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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