301重定向无片段 [英] 301 Redirect without fragment
问题描述
可能重复:
URL片段和302重定向
Possible Duplicate:
URL Fragment and 302 redirects
关于没有特殊字符的301重定向,我需要提供帮助.
I need to help regarding the 301 Redirect without Special character.
例如,我要重定向以下URL:
For example, I want to redirect the following URL:
http://www.iphoneapplications.us/iphone-ipad-mobile-apps-portfolio.html#Gigguid
到以下URL:
http://www.i-phonedeveloper.com/portfolio.html
我已经更改了.htaccess
来执行重定向,但是片段#Gigguid
保留在最终URL中.该如何解决?
I have changed .htaccess
to perform the redirect, but the fragment #Gigguid
remains in the final URL. How can this be fixed?
推荐答案
当前的HTTP标准不允许您执行这样的重定向-至少HTTP客户端拒绝这样做.您的浏览器将始终将#...
部分添加到重定向URI.
The current HTTP standard does not allow you to do such a redirect - at least the HTTP client is refusing to do so. Your browser will always add the #...
part to the redirect URI.
顺便说一下,这个#....
被称为 Fragement ,特殊字符并没有说太多(URI有很多特殊字符,例如:
,%
,?
和&
),最好为此使用正确的名称.
This #....
is called Fragement by the way, special character is not saying much (a URI has many special characters like :
, %
, ?
and &
), better use the right name for this.
下一个HTTP标准版本可能会解决该问题,但是它仍然有些脆弱,其含义有时在草案中有所更改,并且由于我无法展望未来,现在如何处理此问题还为时过早. HTTP的下一个稳定版本.
The next HTTP standard release will likely take care of that issue but it's still a bit fragile, the meaning has changed sometimes in the draft and as I can not look into the future it's yet too early how this will be done with the next stable release of HTTP.
有关更多信息,请参见此问题:
See as well this question for more information:
- URL Fragment and 302 redirects
- PHP Location Header Ignore Hash
这篇关于301重定向无片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!