虚拟机的DocumentRoot路径是/var/www/html/dir1/dir2
rewrite规则是写在.htaccess文件中的。
RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php这个时候,访问正常。如果改成:RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php [P,L]就会发生错误,chrome浏览器返回:
The requested URL /var/www/html/dir1/dir2/index.php was not found on this server.
应该是404了吧?请问发生这个错误的原因是什么,应该如何处理。
rewrite规则是写在.htaccess文件中的。
RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php这个时候,访问正常。如果改成:RewriteEngine on
RewriteBase /
RewriteRule rewrite.html index.php [P,L]就会发生错误,chrome浏览器返回:
The requested URL /var/www/html/dir1/dir2/index.php was not found on this server.
应该是404了吧?请问发生这个错误的原因是什么,应该如何处理。
解决方案 »
- 求助,编写人人公共主页定时自动发送状态网页
- 如何获取BitTorrent的种子数,下载者数和种子健康度。
- 50讨论ajax重用性
- 如何动态设置页面编码?
- 求助:格式化这样的一个json串,语法该怎么写?(急!)
- php初学者成长的烦恼
- 如何在Windows 98 和 Windows 2000 上安装和配置 PHP4.3.0 + Apache 2.0.44 + MySQL 4.0-gamma?
- 如何将mysql导出为文本或是网页,用php如何生成动态页面?
- smarty 页面中插入js ,并在js 中调用smarty 模版内容 怎么搞?
- 除了增删改查,你还会些什么
- 刚刚看了某网站,发现一个图片攻击问题,怎么防范
- php 定时器如何实现
L(last rule) 表明当前规则是最后一条规则,停止分析以后规则的重写。不明白为什么要 P
用NC修饰试试
不瞒您说,其实我也不是很明白。
俺是因为某个项目,刚刚开始学习rewrite,很白。
这里加P,是从某些例子中看来的。可,无论如何,为啥加了P,就出这种问题呢?
而 你的 RewriteBase 为 / 在配上物理路径就是 /var/www/html/dir1/dir2/index.php
如何能找到?