index.php?action=affiliate/registration
/affiliate/registration/
我想重写这个URL到index.php?action=notfound因为在URL的任何部分都有affiliate/registration子string。
我会做这样的事情:
# Don't rewrite if the request is for a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)(affiliate|registration)+(.*) index.php?action=notfound [QSA,L]
如果总有一个/之前,我宁愿做:
# Don't rewrite if the request is for a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/(affiliate|registration)+(.*) index.php?action=notfound [QSA,L]
如果总有一个/后,我宁愿做:
# Don't rewrite if the request is for a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)(affiliate|registration)+/(.*) index.php?action=notfound [QSA,L]
如果总有一个/之前和之后,我宁愿做:
# Don't rewrite if the request is for a real file or directory RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*)/(affiliate|registration)+/(.*) index.php?action=notfound [QSA,L]