Phetolelo e Ncha ea Domain Domain (Regex) e Tsamaisa Bocha ka WordPress

Regex - Lipolelo tse tloaelehileng

Bakeng sa libeke tse 'maloa tse fetileng, esale re thusa moreki ho falla ka mokhoa o rarahaneng ka WordPress. Moreki o ne a e-na le lihlahisoa tse peli, tseo ka bobeli li seng li tumme ho isa ntlheng ea hore ba tlameha ho arola likhoebo, ho beha lebitso le litaba ho arola libaka. Ke mosebetsi o boima haholo!

Sebaka sa bona sa marang-rang se ntse se le teng, empa domain e ncha e tla ba le litaba tsohle mabapi le sehlahisoa seo… ho tloha litšoantšong, liposong, lipatlisisong tsa linyeoe, ho jarollotsoeng, liforomong, setsing sa tsebo, jj. Re entse tlhahlobo le ho khasa sebaka seo ho netefatsa hore ha re batle U se ke ua hloloheloa letlotlo le le leng.

Hang ha re se re fumane sebaka se secha se sebetsang, nako ea ho hula switch ebe re e beha e se e fihlile. Seo se ne se bolela hore li-URL leha e le life tse tsoang sebakeng sa mantlha sa sehlahisoa sena li tlameha ho lebisoa sebakeng se secha. Re bolokile litsela tse ngata tse lumellanang lipakeng tsa libaka tsa marang-rang, ka hona senotlolo se ne se theha litselana ka nepo.

Tsamaisa li-plugins ho WordPress

Ho na le li-plugins tse tummeng tse fumanehang tse etsang mosebetsi o motle oa ho tsamaisa lits'oants'o le WordPress:

  • Phetolelo - mohlomong ke plugin e ntle ka ho fetisisa 'marakeng, e nang le bokhoni ba ho hlahisa maikutlo khafetsa esita le mekhahlelo ea ho tsamaisa lits'oants'o tsa hau.
  • Boemo ba SEO - plugin ena e bobebe ea SEO ke phefumoloho ea moea o hloekileng mme e etsa lenane la ka la Libaka tse Hloahloa tsa WordPress Plugins 'marakeng. E na le litsamaiso hape e le karolo ea nyehelo ea eona mme e tla kenya data ea Redirection haeba u ka fallela ho eona.

Haeba u sebelisa enjene ea Hosting ea WordPress e laoloang joalo ka WPEngine, Ba na le mojulung ona ho sebetsana redirects pele motho eo leha e le neng otla hao sebaka… e ntle e ntle tšobotsi e ka fokotsa latency le holim 'a hao Hosting.

Mme, ehlile, o ka khona ngola melao e fetisetsang ho file ea hau ea .htaccess ya hao Wordpress seva ... empa ke ne ke ke ho kgothaletsa e. U phoso e le 'ngoe ea syntax hole le ho etsa hore sebaka sa hau sa marang-rang se se ke sa fumaneha!

Mokhoa oa ho theha Regex Redirect

Mohlala oo ke o faneng kaholimo, ho ka utloahala ho le bonolo ho etsa feela mokhoa o tloaelehileng oa ho o tsamaisa hape ho tloha foldareng e nyane ho ea ho domain e ncha le foldara

Source: /product-a/
Destination: https://newdomain.com/product-a/

Ho na le bothata ka seo, leha ho le joalo. Ho thoe'ng haeba u tsamaisitse likhokahano le matšolo a nang le lipotso bakeng sa ho latela lets'olo kapa ho fetisoa? Maqephe ao a ke ke a tsamaisa hantle. Mohlomong URL ke:

https://existingdomain.com/product-a/?utm_source=newsletter

Hobane u ngotse papali e ts'oanang, URL eo e ke ke ea u lebisa kae kapa kae! Kahoo, o kanna oa lekeha hore o e hlahise khafetsa ebe o eketsa karete e hlaha ho URL:

Source: /product-a/(.*)
Destination: https://newdomain.com/product-a/

Ho lokile, empa ho ntse ho na le mathata a 'maloa. Pele, e tla ts'oana le URL efe kapa efe le / sehlahisoa-a / ka ho eona ebe u li isa sebakeng se le seng kaofela. Kahoo, litsela tsena kaofela li tla lebisa sebakeng se le seng.

https://existingdomain.com/product-a/
https://existingdomain.com/help/product-a/
https://existingdomain.com/category/parent/product-a/

Lipolelo tsa kamehla ke sesebelisoa se setle, leha ho le joalo. Taba ea mantlha, o ka nchafatsa mohloli oa hau ho etsa bonnete ba hore boemo ba foldara boa tsebahala

Source: ^/product-a/(.*)
Destination: https://newdomain.com/product-a/

Seo se tla netefatsa hore ke feela boemo ba foldara bo ka sehloohong bo tla tsamaisang hantle. Joale bakeng sa bothata ba bobeli… u ka etsa joang hore tlhaiso-leseling e botsoang e hapuoe sebakeng se secha haeba tataiso eo u e romelletseng e sa e kenye? Hantle, lipolelo tse tloaelehileng li na le tharollo e ntle bakeng sa seo hape:

Source: ^/product-a/(.*)
Destination: https://newdomain.com/product-a/$1

Tlhahisoleseling ea wildcard e hlile e nkuoe le ho hlomathisoa moo e eang teng ka ho sebelisa se fapaneng. Kahoo…

https://existingdomain.com/product-a/?utm_source=newsletter

E tla fetisetsa hantle ho:

https://newdomain.com/product-a/?utm_source=newsletter

Hopola hore karete ea hlaha e tla nolofalletsa sephutheloana sefe kapa sefe hore se lebisoe hape, ka hona sena se tla fuoa matla:

https://existingdomain.com/product-a/features/?utm_source=newsletter

E tla fetisetsa ho:

https://newdomain.com/product-a/features/?utm_source=newsletter

Ehlile, lipolelo tse tloahelehileng li ka thatafala ho feta mona… empa ke ne ke batla ho fana ka mohlala o potlakileng oa ho hloma redcard regex redirect e fetisang ntho e 'ngoe le e' ngoe ka mokhoa o hloekileng ho domain e ncha!

2 Comments

  1. 1

U nahana eng?

Sebaka sena se sebelisa Akismet ho fokotsa spam. Ithute kamoo litlhaloso tsa hau li hlahang kateng.