RewriteRule是重定向而不是重写
我有一个如下所示的重写规则:
RewriteEngine On
RewriteRule ^$ store [L]
这是 .htaccess 文件中唯一的内容。
它应该允许某人访问 http://www.site.com/ 并根据服务器,他们正在访问 http://www.site.com/store 。
但它正在重定向用户。换句话说,您会在 URL 中看到“/store”。我该如何避免这种情况?
顺便说一句,/store/index.php(store 目录中的索引脚本)中没有进行重定向。我知道这一点是因为我在那里放置了一个 die 语句,并且当脚本执行时,“/store”位于 URL 中死在那个剧本上。
I have a rewrite rule that looks like this:
RewriteEngine On
RewriteRule ^$ store [L]
That's the only thing in the .htaccess file.
It's supposed to allow someone to go to http://www.site.com/ and according to the server, they're accessing http://www.site.com/store .
But it's redirecting the user. In other words, you see "/store" in the URL. How do I avoid this?
By the way, there's not a redirect going on within /store/index.php (the index script in the store directory. I know this because I put a die statement in there and the "/store" is in the URL when the script dies on that script.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于某种原因,我将其更改为
并
开始工作
For some reason, I changed it from
to
and it started working