I-New Domain Regular Expression (Regex) Iqondisa kabusha ku-WordPress

I-Regex - Izinkulumo Ezijwayelekile

Emasontweni ambalwa edlule, besisiza iklayenti ukuthi lenze ukufuduka okuyinkimbinkimbi nge-WordPress. Iklayenti linemikhiqizo emibili, yomibili eye yathandwa kwaze kwaba yilapho kufanele ihlukanise amabhizinisi, ukufaka uphawu lokuqukethwe, nokuqukethwe ukuze kuhlukaniswe izizinda. Kungumsebenzi omkhulu impela!

Isizinda sabo esivele sikhona sihlala sibekiwe, kepha isizinda esisha sizoba nakho konke okuqukethwe maqondana nalowo mkhiqizo… kusuka ezithombeni, kokuthunyelwe, ekufundweni kwamacala, kokulandwayo, kwamafomu, kwesisekelo solwazi, njll. Senze ucwaningo lwamabhuku futhi sakhasa isiza ukuqinisekisa ukuthi ngeke sikwazi ungaphuthelwa yifa elilodwa.

Lapho sesinendawo entsha esebenza futhi esebenza, isikhathi sokudonsa inkinobho siyibeke bukhoma sase sifikile. Lokho bekusho ukuthi noma yimaphi ama-URL asuka kusayithi eyinhloko okwakungowomkhiqizo kwakufanele aqondiswe kusizinda esisha. Sigcine izindlela eziningi zingaguquguquki phakathi kwamasayithi, ngakho-ke ukhiye wawusetha ukuqondiswa kabusha ngokufanele.

Qondisa kabusha ama-plugins ku-WordPress

Kunama-plugins amabili athandwayo enza umsebenzi omkhulu wokuphatha ukuqondiswa kabusha nge-WordPress:

  • Ukulungiswa kabusha - mhlawumbe i-plugin ehamba phambili emakethe, enamakhono okuveza okuvamile kanye nezigaba zokuphatha ukuqondiswa kwakho.
  • I-Rankmath SEO - le plugin engasindi ye-SEO ukuphefumula komoya omusha futhi yenza uhlu lwami lwe Ama-plugins we-WordPress ahamba phambili emakethe. Iqondisa kabusha njengengxenye yokunikezwa kwayo futhi izongenisa idatha yeRedirection uma uthuthela kuyo.

Uma usebenzisa injini ephethwe ye-WordPress Hosting efana ne- WPEngine, banesimo sokusingatha ukuqondiswa kabusha ngaphambi kokuba umuntu ehlasele isayithi lakho… isici esihle kakhulu esinganciphisa ukubambezeleka nokuhamba phambili ekubanjweni kwakho.

Futhi-ke, ungakwazi bhala imithetho eqondisa kabusha kufayela lakho le-.htaccess kuseva yakho ye-WordPress… kepha angikukhuthazi. Unephutha elilodwa le-syntax ekwenzeni indawo yakho ingafinyeleleki!

Ungayakha Kanjani i-Regex Redirect

Esibonelweni engisinikeza ngenhla, kungabonakala kulula ukwenza nje ukuqondisa kabusha okujwayelekile kusuka kufolda engaphansi kuya kusizinda esisha nefolda engaphansi:

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

Kunenkinga ngalokho, noma kunjalo. Kuthiwani uma usabalalise izixhumanisi nemikhankaso enombuzo wokulandela umkhankaso noma wokudluliselwa? Lawo makhasi ngeke aqondise kabusha kahle. Mhlawumbe i-URL yile:

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

Ngoba ubhale ukufana ngqo, leyo URL ngeke iqondise kabusha noma kuphi! Ngakho-ke, ungalingeka ukuthi ukwenze kube isisho esijwayelekile bese ungeza ikhadi lasendle ku-URL:

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

Kuhle impela, kepha kusenezinkinga ezimbalwa. Okokuqala, kuzofanisa noma iyiphi i-URL ne- / umkhiqizo-a / kuyo bese ubaqondisa kabusha bonke endaweni efanayo. Ngakho-ke zonke lezi zindlela zizoqondisa kabusha ziye endaweni efanayo.

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

Izinkulumo ezijwayelekile ziyithuluzi elihle, noma kunjalo. Okokuqala, ungabuyekeza umthombo wakho ukuze uqiniseke ukuthi izinga lefolda liyabonakala.

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

Lokho kuzoqinisekisa ukuthi kuphela ileveli eyinhloko yefolda ezoqondisa kabusha kahle. Manje ngenkinga yesibili… uzoluthola kanjani ulwazi lombuzo olufakwe kusayithi elisha uma ukuqondisa kabusha kwakho kungakufaki? Yebo, izinkulumo ezivamile zinesixazululo esihle salokho futhi:

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

Imininingwane yekhadi lasendle empeleni iyabanjwa futhi ifakwe endaweni lapho iya khona ngokusebenzisa okuguqukayo. Ngakho…

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

Izoqondisa kabusha kahle ku:

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

Khumbula ukuthi i-wildcard izokwenza ukuthi noma iyiphi ifolda engaphansi iphinde iqondiswe kabusha, ngakho-ke lokhu kuzonikwa amandla futhi:

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

Izoqondisa kabusha ku:

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

Vele, izinkulumo ezijwayelekile zingaba nzima kakhulu kunalokhu… kepha bengifuna nje ukunikeza isampula esheshayo lokuthi ungayisetha kanjani i-wildcard regex eqondisa kabusha edlulisa konke ngokuhlanzeka kusizinda esisha!

2 Amazwana

  1. 1

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.