【发布时间】:2014-04-01 13:07:58
【问题描述】:
我试图使用 Apache mod_rewrite 将 URL 从一个域(例如pesdevelopment.ktm.local)重定向到另一个域(pestest.ktm.local)。
因此我在 Apache 中使用了以下条件和规则:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^pesdevelopment\.ktm\.local$ [NC]
RewriteRule ^(.*)$ http://pestest.ktm.local/$1 [R=302,L]
问题在于包含字符 # 的 URL 未正确重定向。该字符正在停止重写过程,并被重定向到到目前为止已重写的 URL,直到该字符出现在 URL 中。
示例:
The URL pesdevelopment.ktm.local/Windchill/app/#ptc1/ 被重定向到 pestest.ktm.local/Windchill/app/
有谁知道如何处理这种情况?
【问题讨论】:
标签: apache .htaccess mod-rewrite redirect