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的按付款當日價格計算重寫。