url重写 - 蘸了一个额外的参数

时间:2012-10-20 14:03:52

标签: php .htaccess

我在干净的网址中重写我的网站网址(使用.htaccess)。我在.htaccess

中写了这条规则
RewriteRule ^details/([^/]+)/([^/]+) front/detailsnew.php?catid=$1&title=$2 [NC] 

但URL显示如下:

My domain /details/Apartments/409-Palm-Beach-Condos#ad-image-0

我不希望显示#ad-image-0。我的href链接是

My domain/details/European/Test-Bisuwer

有谁知道这里有什么问题?

2 个答案:

答案 0 :(得分:2)

在您的jquery.ad-gallery.js文件中,您需要删除以下行

500以上的行号

评论2行:window.location.hash = "#ad-image-"+ thumb_link.attr("id");

 if(this.settings.update_window_hash) {
            var thumb_link = this.images[this.current_index].thumb_link;
            if (thumb_link.attr("id")) {
              //window.location.hash = "#ad-image-"+ thumb_link.attr("id");
            } else {
              //window.location.hash = "#ad-image-"+ this.current_index;
            };
          };

答案 1 :(得分:0)

网址的#部分是片段。它从未发送到服务器,仅由客户端(浏览器)用于处理内容,或者在某些情况下,用于AJAX或其他javascript彼此通信的方式。你的htaccess文件中没有任何东西可以删除它。浏览器自己生成它。但是查看片段并使用Google搜索,可能与AD Gallery有关,有人提到在使用AD图库时会收到ad-image-个片段。