【发布时间】:2017-01-26 09:41:42
【问题描述】:
我正在尝试将 URL 重定向到带有锚标记的页面。重定向有效,但是如何在重定向后保留原始 URL 而不是重定向的 URL。
我想将www.example.com/caves/ 重定向到www.example.com/trips.html#caves。
当我重定向时,我得到了 URL www.example.com/trips.html#caves,但希望它保留 www.example.com/caves/。
我花了很长时间寻找答案,但没有运气,任何帮助将不胜感激
这是我在 htaccess 中的代码
RewriteEngine on
RewriteRule ^Caves/(.*) /trips.html#Caves [NE,L,R]
【问题讨论】:
标签: apache .htaccess redirect mod-rewrite