URL 重写 - 删除哈希 [英] URL rewriting - removing hash

查看:23
本文介绍了URL 重写 - 删除哈希的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从页面的 URL 中删除井号 (#)?我使用 SWFAddress 插件 (jQuery) 进行深层链接.

How can I remove the hash sign (#) from the page's URL ? I am using the SWFAddress plugin (jQuery) for deep linking purposes.

我需要更换这个

本地主机/站点/#blog

localhost/site/#blog

本地主机/站点/博客

(是的,#blog 只是一个锚点).

(Yes, #blog is just an anchor).

不知何故在 .htaccess 中重写 url 不起作用

Somehow url rewriting in .htaccess doesn't work

RewriteRule/blog #blog [L]

RewriteRule /blog #blog [L]

有什么建议吗?

推荐答案

请求页面时,URL 中带有哈希的位不会发送到服务器,因此您不能使用这样的重定向规则.仅限客户端.

The bit with the hash in the URL is not sent to the server when requesting a page, so you can't use redirect rules like that. It's client-side only.

这篇关于URL 重写 - 删除哈希的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆