我有以下.htaccess
为index.php
提供服务,并阻止显示.txt
个静态文件。
我想添加一个附加规则:将example.com/re
重定向到example.com/re.php
。怎么做?
这失败了,我不知道为什么:
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^re$ re.php //fail: style.css won't be accessible anymore, leading to broken website
RewriteRule ^(.*)$ index.php [QSA,L]
RewriteRule \.txt$ index.php [L]
答案 0 :(得分:1)
正如@CBroe在评论中所指出的, RewriteCond仅影响直接跟随RewriteRule ,因此这是解决方案:
SELECT UPPER(company_name), vat, company_owner_email FROM (
(SELECT company_name, vat, admin.email as company_owner_email FROM pub
LEFT JOIN admin ON pub.manager = admin.id
WHERE company_name > '')
UNION
(SELECT company_name, vat, admin.email as company_owner_email FROM adv
LEFT JOIN admin ON adv.manager = admin.id
WHERE company_name > '')
) company
GROUP BY replace(replace(replace(replace(company_name,'\t',''), ' ', ''), '.', ''), ',','')
ORDER BY company_name;