Akwụkwọ ndekọ ederede
Mgbe e tinyere weebụsaịtị WordPress na Apache, a na-eji faịlụ .htaccess akọwapụta iwu idegharị.
Agbanyeghị, mgbe ụfọdụ, mgbe mmemme ndị ọzọ na-agba ọsọ, dịka ụzọ ndekọ folda subdomain omenala CWP dezie faịlụ vhosts , ọ dị mkpa iwepụ ndekọ nchekwa nchekwa 301 redirect iji zere iwu pseudo-static nke WordPress.
Nke a bụ otu ụzọ enwere ike.
.htaccess faịlụ na-agbakwụnye ewepu iwu ndekọ nchekwa

Ọ bụrụ na ịchọrọ ịtụgharị ndị ọrụ na ngalaba subdomain na-enweghị ngalaba www dị elu , ịkwesịrị ịgbakwunye iwu ntụgharị na faịlụ .htaccess iji wepụ ndekọ folda ụfọdụ. ▼
RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]Tinye koodu a n'ihu iwu nke mbụ iji nweta ọrụ mkpochapụ ndekọ aha akọwapụtara ▼
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/img.chenweiliang.com/.*$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]- Ka emechara ntọala ntọala, nweta ndekọ ndekọ
/img.chenweiliang.com/Agaghị ahazi ibe dị n'ime site na WordPress.
Enweghị ike ibugharị ndekọ ndekọ nke abụọ /go/
Blọọgụ Chen Weiliang ji ụdị akwụ ụgwọ nke ngwa mgbakwunye WordPress GTranslate, ekwenyekwala na ngwa mgbakwunye GTranslate anaghị eji /go/ dịka subdirectory ma ọ bụ subdomain.
Achọtara site na ngwa mgbakwunye Pretty Link iji gbakwunye redirectsChen WeiliangblọgụtelegramMgbe ọwa na-ejikọta:
https://www.chenweiliang.com/go/tgchannel
- (Nke a bụ n'ihi na njikọ redirect nke nkwụnye Pretty Link na-edegharị iwu redirection RewriteRule na faịlụ .htaccess)
Ọ ga-amali na-akpaghị aka gaa na aha ngalaba ngalaba na-adịghị adị:
http://go. chenweiliang.com/go/tgchannel
- (Ka ịzenarị njikọ ndị nwụrụ anwụ, tinye oghere mgbe ị gachara. na njikọ dị n'elu)
Agbanyeghị, nchọcha nke faịlụ .htaccess nke blọgụ Chen Weiliang ahụghị RewriteRule nwere /go/.
Mgbe m nwara ihichapụ GTranslate config RewriteRule, ebugharịrị njikọ a nke ọma:
https://www.chenweiliang.com/go/tgchannel
- Yabụ, ejiri m n'aka na ọ bụ GTranslate config RewriteRule na-akpata njehie redirection maka njikọ subdirectory /go/.
Kedu ka esi ewepu /go/ redirection subdirectory?
Ọ bụrụ na ịchọrọ iwepụ ọtụtụ obere ndekọ dị iche iche, ị nwere ike ileba anya na iwu ntụgharị dị n'okpuru iji tinye ha ▼
RewriteCond %{REQUEST_URI} !^/?(directory1|directory2)($|/)- Na
directory1|directory2|etcTinye nọmba ndekọ aha achọrọ na ya. - Nke a kwesịrị ịbụ "ọ bụrụ na REQUEST_URI ebidoghị na / directory1 ma ọ bụ / directory2".
Ọ ga-adaba:
- / directory1/dasdas
- /ndekọ1
- /akwụkwọ ndekọ aha1/
na ọtụtụ ndị ọzọ ……
Otu esi edobe njikọ mwepu /go/ jumping na RewriteRule?
Naanị tinye iwu na-esonụ "Wepụ / go/ subdirectory redirection" n'elu iwu redirection 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 ###Enwere m olileanya na isiokwu "Ewepụ 301 Redirects na Bypass Pseudo-Static Exception Folder Rules in .htaccess" nke e kesara na blọgụ Chen Weiliang ( https://www.chenweiliang.com/ ) ga-abara gị uru.
Nwere onwe gị ịkọrọ njikọ akụkọ a: https://www.chenweiliang.com/cwl-28236.html
