简体   繁体   English

Apache mod_rewrite,RewriteCond问题

[英]Apache mod_rewrite, RewriteCond issue

At this question: mod rewrite to remove file extension, add trailing slash, remove www and redirect to 404 if no file/directory is available 在这个问题上: mod rewrite删除文件扩展名,添加斜杠,删除www,如果没有可用的文件/目录,则重定向到404

In the solution I see this: 在解决方案中,我看到以下内容:
RewriteCond %{DOCUMENT_ROOT}/$1.php -f

Could you please someone explain what $1 means here??? 能否请您解释一下$1在这里意味着什么???

( If the question title is not appropriate, please change it, thanks. ) 如果问题标题不合适,请更改,谢谢。

$1 is the result of the first captured regex previously specified in a RewriteRule statement. $1是先前在RewriteRule语句中指定的第一个捕获的正则表达式的结果。

See the official documentation here: http://httpd.apache.org/docs/current/mod/mod_rewrite.html 请参阅此处的官方文档: http : //httpd.apache.org/docs/current/mod/mod_rewrite.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM