我想通过使用。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。
Thanks in advance
修改代码为:
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_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(index'.php|register'.php)$
RewriteRule ^(.*)$ index.php? [L,R=301,E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]