Redirect or Rewrite to Remove Double or Multiple Slashes (//) in URL重定向或重写,以消除双重或多重斜线( / / )在网址
Google search engine spider or crawler Googlebot is one of the most advanced and finest content grabber that extracts most if not all of any data of the Internet and World Wide Web, regardless of whether such contents or web pages are intended for public visitors. Google搜寻引擎蜘蛛或履带Googlebot是其中一个最先进和最优秀的内容采集提取最如果不是所有的任何数据,互联网和万维网,不论这些内容或网页供公众参观。
As such, some webmasters may notice that Google is crawling and indexing web pages which are not supposed to be existed in the first place.因此,有些网站管理员可能会注意到, Google是抓取并编制索引的网页,这是不应该存在,摆在首位。 One such instance is incorrect and wrong URL link location, such as when double slash, triple slash or multiple forward slashes been formed as part of the URL as extra slash or slashes been appended or added to the web page URLs.这样一个实例是不正确和错误的URL连结位置,例如当双斜线,三重斜线或多个正斜线已形成了部分的URL作为额外的斜线或斜线被附加或添加到网页的网址。 For example, a page with URL of http://www.domain.com/index.php is also been crawled by Google as http://www.domain.com//index.php, or sometimes even http://www.domain.com///index.php.举例来说,一个网页的网址http://www.domain.com/index.php也是被Google检索作为http://www.domain.com//index.php ,或有时甚至的http:// www.domain.com///index.php 。
The web crawl and spider indexing by Google can be tracked and traced in Apache or web server access logs.网页蜘蛛抓取和索引由Google可以跟踪和追查,在Apache或Web服务器的访问日志。 And these double slash, triple slash, quadruple or more slash URLs can show up in the Google search results, and potentially can cause duplicate content issue , and worse, penalty that makes the site vanishing from Google search results listing or been pushed into supplemental results with low ranking.这些双斜线,三重斜线,四倍或以上的斜线的URL都可以显示在Google搜索结果中,而且可能会造成重复的内容问题,更糟的是,罚款,使网站消失从Google搜索结果中上市或已被推入补充结果低的排名。
The reason for additional slashes in the URL is unknown, and seems like it only happens on Google search engne.原因是额外的斜线在URL中是未知的,好像只发生在Google搜寻engne 。 One possibility is visitors or other websites type or put incorrect backlink (external link), which picked up by ultra-sensitive一种可能性是访客或其他网站的类型或提出不正确反向(外部链接) ,其中拾起由超敏感 Googlebot or Mediapartners-Google Googlebot的或mediapartners Google的 (Google AdSense crawler which also contribute website indexing of Google Search). ( Google AdSense的履带,其中也有助于网站索引的Google搜寻) 。 But one thing is for sure - when one page with wrongful double or a few adjacent slashes been indexed, entire web pages within the website may be prone to such error too.但有一件事是肯定的-当一个网页与不法行为的双重或几个毗邻的斜线被索引,整个网页内的网址可能会容易受到这种错误太多。
To fix and resolve the double slash or multiple slash URLs issue is pretty simple.修复和解决双斜线或多重斜线网址的问题是很简单。 Simply create a mod_rewrite directive in .htaccess code or Apache httpd.conf configuration file to rewrite or redirect permanently (status 301) all URL found to be contained two or more adjacent or trailing slashes to its proper and valid URL with just a single slash (/) instead or // or /// or even //// or more within the URL address, create a .htaccess file in the root directory (normally public_html) for the website with the following URL rewriting and redirection directive (if .htaccess already exists, just add in the code on top).只要创建一个mod_rewrite指令在。 htaccess的代码或Apache的httpd.conf配置文件重写或重定向永久(地位301 )所有的网址,发现载两个或两个以上的毗邻或尾端斜线其适当和有效的URL ,只要一个单一的斜线( / ) ,而不是和/或/或/ / /或什至/ / / /或以上, URL地址,创建一个。 htaccess的文件在根目录(通常public_html )的网站上与下面的URL重写和重定向的指令(如。 htaccess的已经存在,只是添加在代码中对顶端) 。
# Remove multiple slashes anywhere in URL #删除多个斜线的任何地方网址
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$ rewritecond % ( request_uri ) ^(.*)//(.*)$
RewriteRule . rewriterule 。 %1/%2 [R=301,L] % 1 / % 2 [ r = 301 ,升]
The above redirection or URL rewrite method will parse the complete URL section on the part after the domain name, and will change each part of double slash to single slash (and thus able to handle more than 2 slashes in URL too).上述重定向或网址重写方法将解析完整的URL一节以后的部分域名,并会改变的每一部分,双斜线,以单一的斜线(从而能够处理超过2斜线在太长) 。 For administrators who want to more efficient rewrite command, use the following code, which can only be used on .htaccess file.为管理员谁想要更有效地重写命令,使用下面的代码,只能用于对。 htaccess的文件。
# Remove multiple slashes after domain #删除多个斜线后,网域
RewriteRule ^/(.*)$ http://www.domain.com/$1 [R=301,L] rewriterule ^/(.*)$ http://www.domain.com/ $ 1 [ r = 301 ,升]
Replace domain name accordingly.取代的网域名称。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要说明 :这是一个机器翻译网页是“按原样”提供的担保。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article原来的英语文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和贡献,或取得技术的支持和帮助,在 My Digital Life Forums 我的数字生活论坛 . 。
Related Articles相关文章
- Add Trailing Slash to the End of the URL with .htaccess Rewrite Rules添加斜线到去年底的网址。 htaccess的重写规则
- SEO Friendly Rewrite Method to Move Website URL From Subdirectory to Root Parent Folder徐友好重写方法动议网址从子目录,以根父文件夹
- Redirect Blogger RSS Feed to FeedBurner for Detailed Statistics and Monetize Ads重定向Blogger的RSS馈送到feedburner为详细的统计资料和财源的广告
- Remove and Delete Some URL Entries from Address Bar History of FireFox and Internet Explorer移除并删除一些网址参赛作品从地址栏的历史, Firefox和Internet Explorer
- Edit Internet Explorer Typed URLs in Address Bar Dropdown List编辑Internet Explorer中键入网址,在地址栏下拉列表
- Disable and Remove Bookmarks, Favorites, Pages in Tabs and Last Visited Sites from Firefox 3 URL Location Address Bar禁用和删除书签,收藏夹,页面在标签和上次访问的网站从Firefox 3的URL地址栏的位置
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005卸载和删除多个数据库实例的Microsoft SQL Server 2005
- Running Multiple Instances of Windows Live Messenger (WLM) Polygamy and Remove Banner Ads with MultiLive运行多个实例的Windows Live Messenger ( wlm )一夫多妻制和移除的横幅广告与multilive
- WordPress Permalinks Does Not Work in xampp Setup在WordPress永久不工作, xampp安装
- Mozilla Released Firefox 2.0.0.12 to Fix Security and Stability Problems Mozilla发布Firefox的2.0.0.12修复的安全和稳定问题

































July 29th, 2008 19:33 2008年7月29日19时33分
Thanks a lot, a friend ask me how to remove that and we find the solution here感谢了很多,一位朋友问我如何删除,以及我们找到解决办法在这里
August 18th, 2008 03:00 2008年8月18日03:00
I am sorry but this causes trouble with IE 8 web slicing by breaking it, and only works in the root directory.我很抱歉,但这个麻烦的原因与即8网页切片突破,只有在工程的根目录。
All sub directory listings will get triple slashes and expose server side includes, from the new perl hacks available.所有分目录列表,将获得三重斜线和揭露服务器端包括,由新的Perl黑客可用。
Warning:警告:
If you use any password protected logins, do not include this in your htaccess mod rewrite.如果您使用任何密码保护的登录信息,不包括在您的htaccess的按付款当日价格计算重写。