是什么导致我的网站加载并在最后添加“#”?

时间:2013-04-24 07:44:59

标签: .htaccess redirect pageload

我认为我的.htaccess文件中可能存在导致我的页面加载然后“弹回”到我的域末尾添加#的顶部,如下所示:example.com/#

这是我的htaccess文件:

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Start Category Redirects

Redirect permanent /check-out-this-page-tration http://example.com/this-page/

Redirect permanent /rewards http://example.com/example-reward-coupons-page/

Redirect permanent /p-photo-entries http://example.com/2012-contest-photos/


# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>


# BEGIN WordPress
RewriteRule ^index\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]

# END WordPress

关于我应删除或更改内容的任何想法?

1 个答案:

答案 0 :(得分:1)

客户端(网络浏览器)使用

URL fragments来帮助确定如何处理它试图显示的内容。

这可以是跳转到页面的某个部分,或者由javascript用于在其他脚本之间发送信息的锚点。这不是你的htaccess文件,因为片段永远不会发送到服务器(你的htaccess文件所在的位置)。

尝试有选择地删除javascript(尤其是从第三方网站加载的脚本,例如“添加到任意”),否则请确保您的内容中没有链接,如下所示:

some/path/file.html#