WordPress: tshem qhov URL sau dua tshiab txoj cai phau qhia .htaccess

Li cas los ncaj qha mus saib ib directory rau cov hauv paus hniav ntawm tus neeg rau zaub mov hosting yog WordPress yog configured mus ua hauj lwm nrog ib tus phooj ywg URL?

htaccess

Teeb meem

Peb yeej paub tias thaum koj yuav nkag ib directory rau cov hauv paus hniav ntawm tus neeg rau zaub mov, cias muab tus sau ntawd yuav lub npe ntawd directory. Li ntawd, Piv txwv, Yog hu ua cov directory “uploads”, koj saib nws los ntawm qhov chaw nyob http://taylorlopes.com/uploads.

Qhov teeb meem yog tias thaum teem tau WordPress (los yog lwm yam mob) nrog tus phooj ywg URL, Zoo li cas yog thaum muaj ib nplooj hu ua muaj mob muaj ib qhov URL http://taylorlopes.com/?page_id = 2, yuav ib yam dab tsi zoo li http://taylorlopes.com/contatos. Nco ntsoov tias qhov tshiab uas tsis muaj qhov URL (Tus phooj ywg DITA), Nws tsa hu txog tus directory, thaum uas muaj mob yeej yog tsis ib directory, xwb, tab sis ib sab.

Tsis ntev, txij lub caij koj yuav txiav txim seb yuav siv tus phooj ywg URL yog tsis kos ib directory, vim WordPress interprets no li hu rau ib sab, uas obviously tsis nyob ua ib ke, thiab throws qhov yuam kev “OPS! Nplooj ntawv no ua tsis tau nyob“. Li ntawd, Yuav ua li cas rau kos ib directory tsis tas cov WordPress txhais tham muaj tshwm rau ib sab?

Tov

Mus daws cov teebmeem no thiab yuav tau ncaj qha mus saib tau ib directory hauv lub hauv paus hniav ntawm tus neeg rau zaub mov los tsis muaj tus WordPress txhais nws ua ib sab, Qhib cov ntaub ntawv .htaccess thiab ntxiv cov nram qab no txoj kab hauv qab no tus thawj tsab ntawv RewriteRule, hloov “MyDir” lub npe koj tam sim no directory:

Chaws ib nrab

RewriteCond %{REQUEST_URI} !^/(MyDir|MyDir/.*)$

Teb chaws

# PIB WordPress
<IfModule mod_rewrite.(c)>
Rewriteengine hauv RewriteBase /
RewriteRule ^ Performance index yog muaj.piav tes - [L L]
RewriteCond %{REQUEST_URI} !^/(MyDir|MyDir/.*)$
RewriteCond %{REQUEST_FILENAME} !-FwriteCond %{REQUEST_FILENAME} !-d RewriteRule . /xyaw.PHP [L L]
</Yog tias muaj neeg nyob hauv tsev>
# END WordPress

Ceeb toom:

Tus .htaccess yog ntawm lub hauv paus ntawm tus directory qhov twg web sab kawm yog luam tawm, piv txwv hais tias nyob rau hauv tus thawj tswj /www (Wampserver) los sis /htdocs (ntog).

ua kom yuam kev

Tsab cai idea no yog ua ib qho ncej (Phab) teb los ntawm ob tug phooj ywg URLs, ua li no, ib txhia neeg http://taylorlopes.com/about (nplooj ntawv Txog tsis muaj) liab http://taylorlopes.com/sobre (Phab raws li Tshwmsim). Siv lub .htaccess ua qhov redirect:

Chaws ib nrab

liab liab /Txog /raws li

Teb chaws

# PIB WordPress
<IfModule mod_rewrite.(c)>
Rewriteengine hauv RewriteBase /
RewriteRule ^ Performance index yog muaj.piav tes - [L L]
RewriteCond %{REQUEST_URI} !^/(hlauv|hlauv/.*)$
RewriteCond %{REQUEST_FILENAME} !-FwriteCond %{REQUEST_FILENAME} !-liab liab /Txog /Hais txog RewriteRule . /xyaw.PHP [L L]
</Yog tias muaj neeg nyob hauv tsev>
# END WordPress

Tau qhov twg los

WordPress: Exclude directory los ntawm URL rewrite nrog..htaccess

Tag nrho hits: 8286

sau ntawv cia

Qhov koj email chaw nyob yuav tsis muab luam tawm. Search yog cim muaj *