【发布时间】:2012-11-09 07:18:32
【问题描述】:
当 URL 包含 + 或 % 字符时,我想将该 URL 重定向到我编写的 php 重定向脚本。正则表达式 (.+)(?:+|%)(.*)?可以工作并找到包含 + 或 % 的任何 URL,但在 htaccess 中使用时它将无法工作 -
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} (.+)(?:\+|%)(.+)?
RewriteRule ^(.*)$ /directory/content/my-redirect-rewrite.php [L]
我做错了什么?感谢您的观看。
【问题讨论】:
标签: regex apache .htaccess http redirect