开发者

mod_rewrite - rule redirects when redirect not wanted

开发者 https://www.devze.com 2023-03-25 16:36 出处:网络
I have the following: # 开发者_如何学运维Enable Redirects RewriteEngine On RewriteBase / Options +FollowSymlinks

I have the following:

# 开发者_如何学运维Enable Redirects
RewriteEngine On
RewriteBase /
Options +FollowSymlinks
Options -Indexes

RewriteRule ^sitemap\.xml$ http://%{HTTP_HOST}/index.php?route=feed/google_sitemap [L,NC]

From what I've read it should just internally rewrite sitemap.xml to http://%{HTTP_HOST}/index.php?route=feed/google_sitemap and not do any redirecting (i.e. changing the URL in the browser), but it is doing and I don't want that.

Can someone point out why please?

I've tried removing the L flag, thinking maybe it's to do with the characters in the URL?


Actually, if I'm not mistaken, mod_rewrite redirects upon getting served with a http-link. What happens if you remove http://%{HTTP_HOST}/? Try it out, and let us know what happens!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号