热搜:NVER node 开发 php

iis服务器 隐藏index.php

2024-09-06 11:35:02
iis服务器 隐藏index.php

[ISAPI_Rewrite] 
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^dj313.com/ [NC]
RewriteRule ^(.*) http://www.dj313.com [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$   /index.php/$1 [L]

这样隐藏index错了吗?我的真实路径是www.dj313.com/index.php/huati/i44/这个 ,我想把index.php去除变成www.dj313.com/huati/i44/!这样写哪里有问题,怎么一直访问的都是首页呢?


回复讨论(解决方案)

那你 www.dj313.com/index.php/huati/i44/ 不也是访问的首页吗?

额 不是啊,是其他模块啊,你没看到输出的不一样吗?index是首页,huati是其他模块的

我装的是ISAPI_Rewrite3_0098.msi这个,测试了一下 RewriteRule ^/index\.html$ /index.php,连这样都没用,但是用301跳转还生效了啊!哪个大大知道什么情况?

RewriteBase /  这个不能表示是当前目录吗?我在后台admin文件夹内用.htaccess 文件,检测url的时候发现 所以的重写怎么都是以根目录为准则的?