Redirect or Rewrite to Remove Double or Multiple Slashes (//) in URL Novirzīt vai Rewrite noņemt divkārši vai vairākkārtīgi 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 meklētājprogrammu zirnekli vai kāpurķēžu Googlebot ir viena no vismodernākajām un labākais saturs mantrausis ka ekstrakti vairums, ja ne visas jebkuru interneta un World Wide Web, datiem neatkarīgi no tā, vai šāda satura vai interneta lapas ir paredzēti valsts apmeklētājiem.
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. Kā tādi, daži webmasters var pamanīt, ka Google ir pārmeklēšanu un indeksēšanu, web lapas, kuras nav paredzēts kas pastāvēja pirmajā vietā. 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. Viens Šādā gadījumā ir nepareizi un nepareizi URL Link Location, piemēram, kad dubultā slīpsvītra, triple slīpsvītru vai vairākas priekšu slashes tika izveidota kā daļa no URL papildus slīpsvītra vai slashes pievienotas vai pievienot Web lapas 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. Piemēram, lappuses ar http://www.domain.com/index.php URL ir bijusi atsaukta ar Google kā http://www.domain.com//index.php, vai dažreiz pat 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. Web indeksēt un zirnekļa indeksāciju Google izsekojamību un meklē Apache vai tīmekļa servera piekļuves žurnāli. 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. Un šie dubultā slīpsvītra, triple slīpsvītra, četrkārtīgs vai vairāk slīpsvītra URL var parādīt līdz ar Google meklēšanas rezultātiem, un potenciāli var radīt dublēt saturu jautājumu, un sliktāk, soda, kas padara vieta saplūšanas no Google meklēšanas rezultātu sarakstā vai ir iestumts papildu rezultāti ar zemu rangu.
The reason for additional slashes in the URL is unknown, and seems like it only happens on Google search engne. Papildu slashes in URL iemesls nav zināms, un, šķiet, tāpat kā tas notiek tikai Google meklēšanas engne. One possibility is visitors or other websites type or put incorrect backlink (external link), which picked up by ultra-sensitive Viena no iespējām ir apmeklētāju citas mājas tipa vai laist nepareizi backlink (external link), kas palielinājās līdz ar ultra-jutīgu Googlebot or Mediapartners-Google Googlebot vai Mediapartners-Google (Google AdSense crawler which also contribute website indexing of Google Search). (Google AdSense kāpurķēžu kuri arī veicinās mājas indeksāciju Google Search). 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. Bet viena lieta ir pārliecināts - ja viena lapa ar nelikumīgu divkāršu vai dažas blakus slashes ir indeksēti, visā internetā lapās vietnē var būt tendētas uz šādu kļūdu pārāk.
To fix and resolve the double slash or multiple slash URLs issue is pretty simple. Noteikt un atrisināt divkāršu slīpsvītru vai vairākām slīpsvītra URL jautājums ir diezgan vienkāršs. 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). Vienkārši izveidot mod_rewrite direktīvu. Htaccess kods vai Apache httpd.conf konfigurācijas failā pārrakstīt vai novirzīt pastāvīgi (statuss 301) visi URL izrādījās satur divas vai vairākas blakus vai aizmugurējā slashes tās pareizu un derīgu URL tikai ar vienu slīpsvītru ( /) vietā vai / / vai / / / vai pat / / / / vai vairāk robežās URL adresi, izveidot. htaccess failu saknes direktorijā (parasti public_html) par tīmekļa vietnē ar šādu URL pārrakstīšana un pārorientācija direktīvai (ja. htaccess jau pastāv, vienkārši pievienot kodu uz augšu).
# Remove multiple slashes anywhere in URL # Remove vairākus slashes jebkur URL
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
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). Iepriekš redirection vai URL pārrakstīt metodi analizējot pilnu URL sadaļā puses pēc domēna nosaukumu, un mainās katru daļu no divkārša slīpa līnija ar vienu slīpsvītru (un tādējādi spēj apstrādāt vairāk kā 2 slashes in URL pārāk). For administrators who want to more efficient rewrite command, use the following code, which can only be used on .htaccess file. Administratoriem, kuri vēlas efektīvāku pārrakstīt komandu, izmantojiet šādu kodu, ko var izmantot tikai. Htaccess failu.
# Remove multiple slashes after domain # Remove vairākus slashes pēc domēna
RewriteRule ^/(.*)$ http://www.domain.com/$1 [R=301,L]
Replace domain name accordingly. Nomainīt domēna nosaukumu atbilstoši.
IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: lapa mašīna iztulkot un pasniegts tàds, "kàds tas ir" bez garantijas. Machine translation may be difficult to understand. Mašīntulkošanas var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.
Related Articles Saistītie raksti
- Add Trailing Slash to the End of the URL with .htaccess Rewrite Rules Pievienot Trailing Slash to beigas URL ar. Htaccess Rewrite Noteikumi
- SEO Friendly Rewrite Method to Move Website URL From Subdirectory to Root Parent Folder SEO Friendly Rewrite metode Pārvietot Website URL No apakšdirektorijā līdz Root Parent Folder
- Uninstall and Remove Multiple Database Instances of Microsoft SQL Server 2005 Atinstalēt un Remove Multiple Database gadījumi Microsoft SQL Server 2005
- Running Multiple Instances of Windows Live Messenger (WLM) Polygamy and Remove Banner Ads with MultiLive Running Multiple gadījumi Windows Live Messenger (WLM) daudzsievību un Remove Banner Sludinājumi ar MultiLive
- Redirect Blogger RSS Feed to FeedBurner for Detailed Statistics and Monetize Ads Novirzīt Blogger RSS Feed uz FeedBurner, lai detalizēti statistikas dati un Monetize Ads
- Seeing Double Wall Clock Redzot Double Wall Clock
- Remove and Uninstall or Disable ModSecurity (mod_security) Izņemiet un atinstalēšana vai Disable ModSecurity (mod_security)
- Redirect, Stream and Listen All Audio, Sound and Music from Windows Mobile 5 and 2003 Devices to Bluetooh Headset or Earpiece Pārorientēt, Stream un klausīties Visas Audio, Skaņa un mūzika no 5 Windows Mobile un 2003 Ierīces, lai Bluetooh Austiñas vai auss
- Double Driver Backups and Restores Device Drivers in Simple Steps Double Driver Backups un atjauno Device Drivers in Simple Steps
- No Sex Interaction In Airbus A380 Double Bed Suites Nē Sex mijiedarbību Airbus A380 Double Bed Suites










































September 20th, 2009 02:25 20 septembris 2009 02:25
Works like a charm. Darbojas kā šarmu. Was getting some 404 errors in my logs due to extra slashes from referring pages and this fixed it. Bija panākt, dažas 404 kļūdas manā apaļkokiem sakarā ar papildu slashes no atsaucoties lapas, un tas nosaka to.
Thanks! Pateicība!
September 1st, 2009 16:36 1 septembris 2009 16:36
I think it would make more sense to use some RegExp in the RewriteCond. Es domāju, ka tas būtu daudz lietderīgāk izmantot dažas RegExp in RewriteCond.
So you are not limited to two slashes, it can handle any number bigger than two. Tāpēc jums ir ne tikai divas slashes, tā var rīkoties ar jebkuru skaits lielāks par divi.
RewriteCond %{REQUEST_URI} ^(.*)/{2,}(.*)$ RewriteCond% (REQUEST_URI) ^(.*)/{ 2 ,}(.*)$
Example: Piemērs: http://www,bla.de////bla///bla/index.html http://www, bla.de / / / / bla / / / bla / index.html become kļūt http://www,bla.de/bla/bla/index.html http://www, bla.de / bla / bla / index.html
bye dudes bye dudes
August 4th, 2009 20:01 4 augusts 2009 20:01
LOL LOL
I was looking for such an .htaccess rule too, and at the same time reading Tiger SEO's blog. Es meklēju šādas. Htaccess noteikums ir pārāk un tajā pašā laikā lasījums Tiger SEO's blog.
Funny to see him commenting there ^^ Smieklīgi redzēt viņa komentēšanu tur ^ ^
July 22nd, 2009 12:13 Jūlijs 22, 2009 12:13
[...] [...] http://www.mydigitallife.info/2008/07/21/redirect-or-rewrite-to-remove-double-or-multiple-slashes-in.. http://www.mydigitallife.info/2008/07/21/redirect-or-rewrite-to-remove-double-or-multiple-slashes-in .. . . [...] [...]
July 8th, 2009 16:05 8 jūlijs 2009 16:05
Can any one tell me that how can i replace this double slashes to single slash in the following C# snippet. Vai kāds man pateikt, ka es varu nomainīt šo divkāršo slashes vienkārša slīpsvītra šādā C # fragments.
string Path=@”C:\\Temp\\ooops.bak” string path = @ "C: \ \ Temp \ \ ooops.bak"
January 31st, 2009 20:02 Janvāris 31, 2009 20:02
Hi! Čau! Is there a way to remove a single slash in the end of the URL? Vai ir veids, lai novērstu viena slīpa līnija, kas beigās URL? for example, piemēram, http://www.example.com/blog/ http://www.example.com/blog/ to uz http://www.example.com/blog http://www.example.com/blog
August 18th, 2008 03:00 Augusts 18, 2008 03:00
I am sorry but this causes trouble with IE 8 web slicing by breaking it, and only works in the root directory. Man žēl, bet tas rada problēmas ar IE 8 web sagriešana salaužot to un darbojas tikai saknes direktorijā.
All sub directory listings will get triple slashes and expose server side includes, from the new perl hacks available. Visi sub directory sarakstus saņemsiet trīskāršosies slashes un eksponēšanas servera puses ietver, no jauna perl hacks pieejams.
Warning: Brīdinājums:
If you use any password protected logins, do not include this in your htaccess mod rewrite. Ja Jūs lietojat jebkādas aizsargāta ar paroli autorizācijas, nav jāiekļauj šī jūsu htaccess mod pārrakstīt.
July 29th, 2008 19:33 Jūlijs 29, 2008 19:33
Thanks a lot, a friend ask me how to remove that and we find the solution here Thanks a lot, draugs man jautā, kā noņemt, un mēs atrastu risinājumu šeit