Back to Question Center
0

301 tura da Semalt: Duk hanyoyi na URL zuwa hanya guda

1 answers:

Ina ƙaura shafin yanar gizo daga wannan dandamali zuwa wani, kuma a cikin wannan tsari, Ina kawar da tsohon sunan yankin. Babu dangantaka tsakanin kai tsaye tsakanin hanyoyin da tsoho da sabon shafin yanar gizon, sabili da haka, Ina so in sake tura duk hanyoyin da suka wuce zuwa shafin yanar gizon yanar gizo: I. e - transfer unclaimed super. yan yanki. misali / kowane_path ya kamata a juya zuwa shafi na gaba sabon yanki. misali . Ina sane da sakamakon SEO na wannan.

Taimakon na yanzu shi ne yin amfani da umarnin RedirectPermanent, don haka . htaccess a cikin farfadowa na tushen yankin ya ƙunshi:

     RedirectPermanent / https: // sabon yanki. misali /    

Yaya zan iya cimma duk wata hanya a kan yan majalisar dattijan. misali (e. g. yan yanki. misali / kowane_path ) an juya shi zuwa shafi na gaba (ba hanyar daidai ba) na sabon yanki. misali ?

February 5, 2018

Ina tsammanin wannan ya kamata ya yi abin zamba a gare ku. A tsohuwar yankin, sanya wannan lambar a cikin . fayil na htaccess (wannan yana nuna mai amfani da 301).

  RewriteEngine On
RewriteRule (. *) https: // sabon yanki. misali [R = 301, L] 

Taimakon na yanzu shi ne amfani da Jagorar RedirectPermanent

Umurnin RedirectPermanent (mod_alias) shine prefix daidai da haka, kamar yadda ka samo, za a juya ka zuwa hanyar "daidai" a kan sabon yanki.

Duk da haka, ƙaddamarwa ta mod_alias RedirectMatch matches ta amfani da regex kuma zai ba ka damar sake tura duk URLs zuwa URL guda ɗaya.

  RedirectMatch 301 / https: // sabon yanki. misali / 

Wannan ya fi dacewa wajen yin amfani da mod_rewrite ( RewriteRule ), sai dai idan kuna amfani da mod_rewrite don sauran turawa.