Php 我们如何将任何请求重定向到同一页面(使用.htaccess的请求除外)

Php 我们如何将任何请求重定向到同一页面(使用.htaccess的请求除外),php,.htaccess,Php,.htaccess,我想使用.htaccess文件重定向同一页上的请求,但不包括一页。我使用的代码 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/index.php RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC] RewriteRule (.*

我想使用.htaccess文件重定向同一页上的请求,但不包括一页。我使用的代码

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
有人知道我如何在一个名为“register.php”的页面上设置条件吗?意味着我现在要打开register.php,打开index.php

提前感谢

将代码更改为:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(index\.php|register\.php)$
RewriteRule ^(.*)$ index.php? [L,R=301,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(index|register)\.php$ [NC]
RewriteRule ^(.+?\.(php|html?|feed|pdf|raw)|[^.]*)$ index.php [L,NC]

RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

嘿,谢谢你的回复。。但如果我使用了你的代码,然后网站就关闭了&如果我在我的代码中使用了你的条件(RewriteCond%{REQUEST_URI}!^/(index.php | register.php)$),那么它看起来和以前一样,你测试的URI是什么?我们可以在这里的任何聊天室见面吗?对不起,我需要参加一个小时的会议,然后我就可以自由聊天了,谢谢你的支持。。你知道它出了什么问题吗?我想你的要求和我的解释有些脱节:(我一个小时后再谈。