隐藏 URL 的 index.php(或 index.html) [英] Hide index.php (or index.html) of an URL
问题描述
当我在浏览器 (mysite.com) 中输入我的网站地址时,它会重定向到 mysite.com/index.php.为什么不 index.html ?因为我是在Apache 2.2的conf文件里改的.
When I type the address of my site in a browser (mysite.com), it redirects to mysite.com/index.php. Why not to index.html ? Because I changed it in the conf file in Apache 2.2 .
- 现在我想隐藏最后一个index.php"部分.我该怎么做?
- index.html 和 index.php 会有所不同吗?
如果通过搜索 google,您最终会访问 www.google.com/index.html,这会不会很丑?...这只是为了美学,但上帝对某些人来说很重要.
Wouldn't be ugly if by looking for google, you would end up on www.google.com/index.html ? ... it's just for esthetics but god is it important to certain people.
推荐答案
我不知道你为什么需要使用 mod_rewrite.在我的网站上我没有做任何隐藏 index.php 的事情,我只是没有在代码中的任何地方指向它,所以我只写 www.example.com/?task 而不是 www.example.com/index.php?task=forum=论坛.它适用于标准的 apache 配置.
I don't know why you need to use mod_rewrite. On my site I did nothing to hide index.php, I just don't point it anywhere in code, so instead of www.example.com/index.php?task=forum I just write www.example.com/?task=forum. It works on standard apache config.
这篇关于隐藏 URL 的 index.php(或 index.html)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!