htaccess redirect in php 中的 link 地址无限重复地址
The link address in htaccess redirect in php repeats the address indefinitely
将此代码放入 .htaccess 后,它会在浏览器中无限重复 url 例如
https://www.example.com/mv/project/mv/project/mv/project/mv/project/mv/project...
.htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ .php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [l,R=404]
你想用这些行代码实现什么RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
,或许我可以提供一些帮助。
下面这部分让您摆脱 .php
文件扩展名。
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ .php
将此代码放入 .htaccess 后,它会在浏览器中无限重复 url 例如
https://www.example.com/mv/project/mv/project/mv/project/mv/project/mv/project...
.htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ .php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [l,R=404]
你想用这些行代码实现什么RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
,或许我可以提供一些帮助。
下面这部分让您摆脱 .php
文件扩展名。
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ .php