.htaccess-通过一个文件读取所有子目录和文件

.htaccess-通过一个文件读取所有子目录和文件,.htaccess,.htaccess,我正在尝试将一个.htaccess文件添加到domain.com/links/中,因此,如果有人访问domain.com/links/mylink/或domain.com/links/mylink,它将被传递到domain.com/links/link.php?link=xxxxx,但我似乎找不到不不断重复的重写规则 RewriteRule ^(.*)$ /links/link.php?link=$1 [L] 上面所做的工作如下 domain.com/links/index.php/index

我正在尝试将一个.htaccess文件添加到domain.com/links/中,因此,如果有人访问domain.com/links/mylink/或domain.com/links/mylink,它将被传递到domain.com/links/link.php?link=xxxxx,但我似乎找不到不不断重复的重写规则

RewriteRule ^(.*)$ /links/link.php?link=$1 [L]
上面所做的工作如下 domain.com/links/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/index.php/something


<IfModule mod_rewrite.c>
RewriteEngine On
# If file exists, don't rewrite
RewriteCond %{REQUEST_FILENAME} !-f
# Rewrite everything to link.php
RewriteRule . /links/link.php [L]
</IfModule>
重新启动发动机 #如果文件存在,不要重写 重写cond%{REQUEST_FILENAME}-F #将所有内容重写为link.php 重写规则/links/link.php[L]
虽然这段代码可以解决这个问题,但如何以及为什么解决这个问题将真正有助于提高您的帖子质量,并可能导致更多的投票。请记住,你是在将来回答读者的问题,而不仅仅是现在提问的人。请编辑您的答案以添加解释,并说明适用的限制和假设。