小弟学习php过程中,提出一个很简单的问题:
比如:真实url:localhost/test/controller/index.php,想在地址栏显示为localhost/test/或localhost/test/index.php,即隐藏真实的url。
我在test下面建立一个index.php,配置了apache的VirtualHost,里面设置servername为test,并写了一个header()跳转到controller文件夹下面,结果不行。有哪位大侠知道怎么搞,给个最简单的例子phpurlrewrite
比如:真实url:localhost/test/controller/index.php,想在地址栏显示为localhost/test/或localhost/test/index.php,即隐藏真实的url。
我在test下面建立一个index.php,配置了apache的VirtualHost,里面设置servername为test,并写了一个header()跳转到controller文件夹下面,结果不行。有哪位大侠知道怎么搞,给个最简单的例子phpurlrewrite
解决方案 »
- PHP安装MYSQL扩展问题
- 如何避免在数据库中使用联合操作
- 有什么方法可以导出MYSQL数据库的表结构?帮忙急
- 启动Apache HTTP Server 2.2.6提示cannot load php4apache2.dll into server
- 摘取字符串
- 我在php中为什么不能用Header("Location:index.php")
- 这个问题困扰了好久,但是还是无法解决.希望各位能够帮忙...
- 表单上有一文本域(textarea),用于查询时输入要查询的关键字?用户要输入多个关键字中间用回车分开,我怎样分开这些值,存在不同的变量里?
- 非常简单的问题~APACHE中我的主页应该放到哪啊?
- 关于page类中的无刷新分页中调用自定义函数是怎么做到的
- 请教版主xuzuning
- 紧急求教PHP版本问题,12:10了我还没有吃饭呢,各位帮忙!!
记事本打开输入如下两行
RewriteEngine on
RewriteRule ^test/index.php$ test/controller/index.php
保存
访问localhost/test/index.php看下能不能访问