iis服务器 隐藏index.php

WBOY
Release: 2016-06-23 14:03:25
Original
974 people have browsed it

[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的时候发现 所以的重写怎么都是以根目录为准则的?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!