在包含字符的Apache中将URL从一个域重定向到另一个域#

在包含字符的Apache中将URL从一个域重定向到另一个域#,apache,.htaccess,mod-rewrite,redirect,Apache,.htaccess,Mod Rewrite,Redirect,我试图使用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] 问题是,包

我试图使用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中

例如:
URL pesdevelopment.ktm.local/Windchill/app/#ptc1/
被重定向到
pestest.ktm.local/Windchill/app/


有人知道如何处理这种情况吗?

以下方法应该有效

RewriteEngine on
RewriteCond %{HTTP_HOST} ^pesdevelopment\.ktm\.local$ [NC]
RewriteRule ^(.*)$ http://pestest.ktm.local/$1%1 [R=302,L]

你尝试过硬刷新页面吗?是的,我尝试过硬刷新。但是它跳到pestest.ktm.local/Windchill/app/有什么想法吗?您的htaccess中还有其他规则吗?我尝试了beta.mysite.com/Windchill/app/#ptc1/tcomp/infoPage?oid=或%3Awt.epm.EPMDocument%3A585162223&u8=1链接,但它重定向得很好。没有,htaccess中没有规则