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.


8 Responses to “Redirect or Rewrite to Remove Double or Multiple Slashes (//) in URL” 8 Atbildes uz "novirzīšana vai Rewrite noņemt divkārši vai vairākkārtīgi Slashes (/ /) in URL"

  1. Glen Glen
    September 20th, 2009 02:25 20 septembris 2009 02:25
    8 8

    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!

  2. DaKorn DaKorn
    September 1st, 2009 16:36 1 septembris 2009 16:36
    7 7

    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

  3. Mike Mike
    August 4th, 2009 20:01 4 augusts 2009 20:01
    6 6

    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 ^ ^

  4. Removing Double Slashes From URLs | Gary Harvey Blog Noņemot Double Slashes No URL | Gary Harvey Blog
    July 22nd, 2009 12:13 Jūlijs 22, 2009 12:13
    5 5

    [...] [...] 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 .. . . [...] [...]

  5. Manish Manish
    July 8th, 2009 16:05 8 jūlijs 2009 16:05
    4 4

    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"

  6. CountOcram CountOcram
    January 31st, 2009 20:02 Janvāris 31, 2009 20:02
    3 3

    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

  7. jeffb jeffb
    August 18th, 2008 03:00 Augusts 18, 2008 03:00
    2 2

    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.

  8. Tiger SEO Tīģeris SEO
    July 29th, 2008 19:33 Jūlijs 29, 2008 19:33
    1 1

    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 :)

Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Jūs varat izmantot šos tagus: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Saņemt informāciju par jaunāko komentārus, parakstīties uz My Digital Life Comments RSS feed Mana Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Ienākošo Meklēt noteikumi pants

akamai redirect double slashes Kaspars Priedols pārvirzīt dubultā slashes - -- apache rewrite remove double slash apache pārrakstīt novērst divkāršu slīpsvītru - -- apache redirect www. Apache novirzīšanu www. DOUBLE FORWARD SLASH DOUBLE slīpsvītra - -- c# strips slashes from network address C # sloksnes slashes no tīkla adrese - -- double slashes in apache dubultā slashes in apache - -- double slash apache dubulta slīpsvītra apache - -- double slash in url dubulta slīpsvītra in url - -- http multiple slashes http vairākus slashes - -- mod rewrite multiple slashes mod pārrakstīt vairākas slashes - -- path name windows xp double slash ceļa nosaukumu windows xp divkārša slīpa līnija - -- php strip first slash from url php sloksne pirmās slīpsvītras no url - -- removing double slashes c# novēršot divkāršu slashes C # - -- remove double slashes apache novērst dubultu slashes apache - -- replace forward slash c# aizstāt slīpsvītra C # - -- send url through javascript with slash nosþtïtu URL, caur javascript ar slīpsvītra - -- why is apache removing double slashes kāpēc apache novēršot dubultu slashes - -- apache rewrite double slash apache pārrakstīt dubultā slīpsvītra - -- disable redirect htaccess izslēgt pārvirzīt htaccess - -- double slash on url string divkāršu slīpsvītru ar url string - -- fix slash url php fix slīpsvītra url php - -- htaccess redirect if wrong url htaccess novirzīt ja nepareizi url - -- mod_rewrite double slash mod_rewrite divkāršu slīpsvītru - -- mod_rewrite double trail slashing mod_rewrite dubultā taka slashing - -- redirect double slash url novirzīt divkāršu slīpsvītru url - -- remove trailing slash URL noņemt trailing slash URL - -- rewrite two slashes added pārrakstīt divas slashes pievienotās - -- single slash in url after https vienu slīpsvītru in url pēc https - -- triple forward slash in url triple slīpsvītra in url - -- two forward slashes in url diviem uz priekšu slashes in url - -- apache rewrite replace part of url apache pārrakstīt aizstāt daļu no url - -- Apach double slashes 404 Apach dubultā slashes 404 - -- double slash in url htaccess divkāršu slīpsvītru in url htaccess - -- friendly url and double slash draudzīgu url un divkārša slīpa līnija - -- htaccess 404 url rewrite transaltion htaccess 404 url pārrakstīt transaltion - -- mod_rewrite doppel slash mod_rewrite doppel slīpsvītra - -- pass slash in url, javascript pass slīpsvītra in url, javascript - -- php htaccess remove trial slash php htaccess noņemt pētījumā slīpsvītra - -- remove double slashes php novērst dubultu slashes php - -- removing double slash from network path + C# novēršot divkāršu slīpsvītru no tīkla ceļu + C # - -- strip multiple slashes regex sloksne vairākus slashes regex - -- apache2 mod_rewrite replace http width https Apache2 mod_rewrite aizstāt http platums https - -- google analytics double slash google analytics dubultā slīpsvītra - -- htaccess remove double slash htaccess novērst divkāršu slīpsvītru - -- htaccess remove two slashes htaccess noņemt divus slashes - -- javascript regular expression remove double slash javascript regulāra izteiksme novērst divkāršu slīpsvītru - -- php remove double slashes php novērst dubultu slashes - -- regex remove multiple instances with single regex noņemt vairākas iestādes ar vienotu - -- triple slash http redirect triple slīpsvītra http pārvirzīt - --