Txoj kev yooj yim tshaj plaws rau kev thauj mus los yog siv cov peev xwm hauv Apache web server, thiab ntau qhov tshwj xeeb, siv cov kev tswj hwm tswj hwm ntawm cov teeb tsa server siv cov htaccess. Cov lus qhia tuaj yeem tso rau hauv cov ntaub ntawv no, los ntawm kev coj ua uas, lub software yuav hloov kho cov neeg tuaj saib rau hauv Is Taws Nem chaw nyob hauv cov ntaub ntawv
Cov Lus Qhia
Kauj ruam 1
Qhib cov ntawv nyeem yooj yim xws li Notepad. Nws lub peev xwm txaus los tsim lub htaccess ntaub ntawv thiab sau nws nrog cov ntsiab lus tsim nyog. Cov lus taw qhia muaj nyob hauv nws li cov kab ntawm cov ntawv nyeem yooj yim thiab tuaj yeem hloov kho kom zoo ib yam li cov ntaub ntawv nrog ncua ntxiv txt, html, js, thiab lwm yam.
Kauj ruam 2
Ua raws cov lus qhia txog kev tsheb mus los uas phim koj cov cai. Yog tias koj xav tau siv xa tag nrho txhua tus qhua ntawm ib qho ntawm cov nplooj ntawv ntawm koj lub vev xaib xa mus rau tib lub URL, ces cov kab hauv qab no yuav tsum muab tso rau hauv htaccess file: Redirect / https://kakprosto.ru Cov Redirect cov lus qhia hauv cov khoom no yog cov qhia rov ua … Cov kab ntawv ncaj qha (luaj li cas) ntawm no txhais cov cag npe ntawm lub xaib, uas yog, qhov kev txiav txim siv rau kev thov rau cov ntaub ntawv hauv txhua daim nplaub tshev ntawm lub xaib. Kev thov rau koj lub xaib cov ntaub ntawv yuav ua rau muaj qhov hloov kho txoj kev hloov pauv. Tab sis yog tias koj muab cov ntawv zoo sib xws nrog lwm cov lus qhia hauv lub subfolder, ces nws cov lus txib yuav saib xyuas qhov tseem ceeb rau Apache. Thiab https://kakprosto.ru ntawm no qhia qhov URL uas server software yuav tsum xa tsheb. Koj yuav tsum tau hloov nws nrog qhov chaw nyob rau koj qhov kev pauv hloov.
Kauj ruam 3
Hloov chaw hauv paus, koj tuaj yeem hais qhia txhua qhov chaw ntawv nplaub tshev. Tom qab ntawd txoj cai hloov tsheb tsuas yog siv rau cov neeg tuaj saib uas xav tau cov ntaub ntawv los ntawm cov npe teev thiab txhua daim nplaub tshev hauv nws. Piv txwv li: Redirect badBoys / nplooj ntawv nrog php txuas ntxiv, tom qab ntawd txoj kev rov ua haujlwm yuav ua haujlwm, thiab yog tias muaj lwm yam (htm, html, thiab lwm yam), ces yuav tsis muaj qhov rov qab los. Tus txheej txheem no yog ua tiav siv RedirectMatch kev taw qhia. Nws siv cov lus qhia tsis tu ncua (regexp) los sib piv cov mob hloov pauv thiab qhov kev thov ntawm qhov browser: RedirectMatch (. *). Php $
Kauj ruam 4
Txuag cov ntawv qhia kev hloov pauv rau cov lus qhia uas hu ua.htaccess thiab muab xa mus rau cov hauv paus hauv paus ntawm koj lub xaib. Thov nco ntsoov tias lub npe cov ntaub ntawv pib nrog lub teev, uas yog, nws tsuas muaj txuas ntxiv, tab sis tsis muaj npe.