pretty的网址没有mod_rewrite的,没有的.htaccess有的、网址、pretty、htaccess

2023-09-02 09:36:38 作者:顾北清歌寒゜

如果没有可能访问的.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(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.