.htaccess ha e kenyeletse 301 redirect bypass pseudo static exception foldara molao oa tsamaiso

Wordpress Liwebsaete li sebelisoa ho Apache ho sebelisa lifaele tsa .htaccess ho hlakisa melao ea ho ngola hape.

Leha ho le joalo, ka linako tse ling ha ho na le mananeo a mang a kang:CWP tloaelo subdomain foldara foldara tsela ea ho Fetola vhosts faele, o hloka ho qhelela ka thoko bukana ea foldara e ikhethileng ea 301, ho feta melao ea pseudo-static ea WordPress.

Se latelang ke mokhoa o mong o ka khonehang.

.htaccess ho kenyelletsa molao oa directory oa foldara 

.htaccess ha e kenyeletse 301 redirect bypass pseudo static exception foldara molao oa tsamaiso

Haeba ho na leE tla itihela ho domain name ea boemo ba bobeli ntle le lebitso la domain la boemo bo holimo, o hloka ho kenya molao oa foldara ea ho se kenyeletse faeleng ea .htaccess ▼

RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]

Beha khoutu ena pele ho molao oa pele oa ho fihlela mosebetsi o boletsoeng oa ho qoelisoa ▼

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
  • Ka mor'a hore litlhophiso li sebetse, kena bukeng ea foldara /img.chenweiliang.com/ Maqephe a ka hare ho WordPress a ke ke a sebetsoa ke WordPress.

Sengoloa sa bobeli /go/ se ke ke sa tsamaisoa hape

Chen WeiliangTšebeliso ea blogWordPress pluginBakeng sa mofuta o lefelloang oa GTranslate, etsa bonnete ba hore plugin ea GTranslate ha e sebelise /go/ joalo ka bukana ea boemo ba bobeli le domain name ea boemo ba bobeli.

E fumanoe ho sebelisoa plugin ea Pretty Link ho eketsa litsela tse lingChen Weiliangtsa blogthelekramoHa mocha o hokela:
https://www.chenweiliang.com/go/tgchannel

  • (Sena ke hobane sehokelo sa ho tlola sa Pretty Link plugin se ngotsoe holimo ke molao oa redirection oa RewriteRule faeleng ea .htaccess)

E tla itihela ho subdomain e seng teng:
http://go. chenweiliang.com/go/tgchannel

  • (Ho qoba lihokelo tse shoeleng, eketsa sebaka ka mor'a hore u tsamaee. sehokelong se kaholimo)

Leha ho le joalo, hoChen WeiliangHo batlisisa faeleng ea .htaccess ea blog ha ea ka ea fumana RewriteRule e nang le /go/.

Kamora hore ke leke ho tlosa GTranslate config RewriteRule, sehokelo sena se ile sa tsamaiswa hape ka katleho:
https://www.chenweiliang.com/go/tgchannel

  • Kahoo, ke na le bonnete ba hore GTranslate config RewriteRule e baka phoso ea ho tsamaisa sehokelo sa subdirectory /go/.

Mokhoa oa ho qhelela ka thoko /go/ subdirectory?

ha ho hlokahalaTlhophisoHo qhelela ka thoko li-subdirectories tse ngata tse fapaneng, o ka sheba melaoana e ka tlase ho e kenyelletsa ▼

RewriteCond %{REQUEST_URI} !^/?(directory1|directory2)($|/)
  • Ho directory1|directory2|etc kenya palo e lakatsehang ea li-directory ho.
  • Sena e lokela ho ba "haeba REQUEST_URI e sa qale ka /directory1 kapa /directory2".

e tla lumellana:

  • /directory1/dasdas
  • /directory1
  • /directory1/

le tse ling tse ngata ……

Mokhoa oa ho beha lihokelo tsa ho se kenyelle /go/ jump jump ho RewriteRule?

Kenya feela taelo e latelang ea "ho se kenye /go/ subdirectory redirectory" kaholimo ho molao oa phetisetso ea GTranslate▼

# Exclude /go/ subdirectory redirection
RewriteCond %{REQUEST_URI} !^/?(go)($|/)

### BEGIN GTranslate config ###
RewriteRule ^([a-z]{2}|af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$ http://$1.chenweiliang.com/$2 [R=301,L,QSA]

RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$ /$1/$3 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)/(.*)$ /wp-content/plugins/gtranslate/url_addon/gtranslate.php?glang=$1&gurl=$2 [L,QSA]
RewriteRule ^(af|sq|am|ar|hy|az|eu|be|bn|bs|bg|ca|ceb|ny|zh-CN|zh-TW|co|hr|cs|da|nl|en|eo|et|tl|fi|fr|fy|gl|ka|de|el|gu|ht|ha|haw|iw|hi|hmn|hu|is|ig|id|ga|it|ja|jw|kn|kk|km|ko|ku|ky|lo|la|lv|lt|lb|mk|mg|ms|ml|mt|mi|mr|mn|my|ne|no|ps|fa|pl|pt|pa|ro|ru|sm|gd|sr|st|sn|sd|si|sk|sl|so|es|su|sw|sv|tg|ta|te|th|tr|uk|ur|uz|vi|cy|xh|yi|yo|zu)$ /$1/ [R=301,L]
### END GTranslate config ###

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) e arolelanoang ".htaccess e kenyelletsa 301 redirect bypass pseudo static exception folder directory", hoa thusa ho uena.

Rea u amohela ho arolelana sehokelo sa sengoloa sena:https://www.chenweiliang.com/cwl-28236.html

Rea u amohela ho mocha oa Telegraph oa blog ea Chen Weiliang ho fumana lintlha tsa morao-rao!

🔔 Eba oa pele oa ho fumana Tataiso ea Tšebeliso ea "ChatGPT Content Marketing AI" ea bohlokoa bukeng ea holimo ea seteishene! 🌟
📚 Tataiso ena e na le boleng bo boholo, 🌟Ona ke monyetla o sa tloaelehang, se ke oa o fetoa! ⏰⌛💨
Share le rata haeba u rata!
Ho arolelana le lintho tseo u li ratang ke khothatso ea rona e tsoelang pele!

 

Comments

Aterese ea hau ea lengolo tsoibila e ke ke ea phatlalatsoa. Ho sebelisoa masimo a hlokahalang * Letšoao

tsamaisetsa hodimo