我有一个简单的PHP MVC架构,它通过public / index.php路由所有请求。我正在使用.htaccess来路由所有请求,并强制执行" wwww"和" https"但我无法弄清楚如何排除robots.txt和sitemap.xml。这是我现在拥有的:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com$ [OR]
RewriteCond %{HTTPS} !on
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
我非常感谢任何意见。
答案 0 :(得分:0)
<% with $SiteConfig %>
<% loop Locations %>
<% if First %>
<div class="row">
<% end_if %>
<div class="col-md-6">
<div class="location-$Pos">
<h6>$City</h6>
<div>$Address</div>
<div>$PhoneNumber</div>
</div>
</div>
<% if MultipleOf(2) %>
</div><% if not Last %><div class="row"><% end_if %>
<% else %>
<% if Last %></div><% end_if %>
<% end_if %>
<% end_loop %>
<% end_with %>
上面的模式((?!robots.txt | sitemap.xml)。*)匹配除 /robots.txt 和 / sitemap之外的任何请求。 xml 。