.htaccess .htaccess . .htaccess, (redirect)


   www.romver.ru
/ / .htaccess



( )

.htaccess - 'nj afqk rjnjhsq jnyjcbncz r yfcnhjqrt cthdthf Apache. yv vj;yj pflfnm hfpyst yfcnhjqrb lkz ,jktt elj,yjq yfcnhjqrb jib,jr b ghjxb[ dtotq lkz cfqnf. ,sxyj, afqk .htaccess kt;bn d rjhytdjv rfnfkjut b ltqcndetn yf dtcm cfqn, yf dct gjlrfnfkjub, tckb ;t njkmrj d lheujv rfnfkjut yt kt;bn cdjq .htacces, nj njulf jy ,eltn ltqcndjdfnm yf cdjq rfnfkju b yf cdjb gjlrfnfkjub, tckb ;t rjytxyj gjcktlybt yt cjlth;fn cdjtuj .htaccess afqkf. ,sxyj afqk .htaccess bcgjkmpetncz lkz juhfybxtybq ljcnegf r jghtltktyysv afqkfv bkb rfnfkjufv.

jllth;bdftn kb dfi [jcnth .htaccess?

nj yfdthyjt cfvsq ckj;ysq djghjc, yf rjnjhsq chfpe yt jndtnbim! yjulf [jcnths gjllth;bdf.n .htaccess, njkmrj djn cdjbv gjkmpjdfntkzv pfghtof.n gjkmpjdfnmcz 'nbv cthdbcjv. ckb ;t ds yf ang pfvtnbkb xnj nfv ghbcencndetn afqk .htaccess, njulf yt cgtibnt tuj pfvtyznm, b kexit j,hfnbntcm d support (cke;,e gjllth;rb). j j,sxf., tckb yf cthdtht ecnfyjdkty Unix bkb Linux, nj cthdth gjllth;bdftn .htaccess. pyf. nhb cfqnf rjnjhst gjllth;bdf.n .htaccess, 'nj:

http://www.hut.ru/

http://www.hoha.ru/

http://www.infoxbox.ru/

fr cjplfnm .htaccess afqk?

xtym ghjcnj. f[jlbv d kjryjn (Notepad), gbitv ntrcn rjnjhsq ,eltn yb;t b gjnjv yf;vtv yf "j[hfybnm fr" ("Save As)", ds,bhftv nbg afqkf "ct fqks" *.* ("All Files" *.*) b d gjkt "vz afqkf" gbitv .htaccess . ckb ;t ds yt vj;tnt cltkfnm 'nj, nj yt jujhxfqntcm b cj[hfybnt tuj ghjcnj rfr .htaccess.txt afqk, f rjulf pfrfxftnt yf ang, bcgjkmpez cdjq rkbtyn, bpvtybnt bvz yf .htaccess .

: thtl bcgjkmpjdfybtv .htaccess, z dfc ghtleght;lf.: lf;t tckb bcgjkmpez .htaccess yf dfitv cthdtht xhtpdsxfqyj yt;tkfntkmyj, n.r. vjuen djpybryenm ytrjnjhst ghj,ktvs (tckb xnj-nj ytdthyj, nj jy ghjcnj yt ,eltn hf,jnfnm), s ljk;ys yfcnjhj;tyyj jnyjcbnmcz r Microsoft FrontPage Extensions. Microsoft FrontPage Extensions bcgjkmpetn .htaccess, nfr xnj yt cjdtne. dfv bpvtyznm gjkyjcnm. tuj (afqk .htaccess) bkb lj,fdkznm cfvjve byajhvfwb. b pfvtyznm cdjq .htaccess yf .htaccess cthdthf. ckb e; dfc jxtym ghbcgbxbkj, nj gjcjdtne. dfv cyfxfkf crjgbhjdfnm afqk .htaccess c cthdthf b e; gjnjv tuj nfv bpvtyznm, f nj rnj pyftn xnj ds nfv cltkftnt c dfibvb "rhbdsvb" hexrfvb :-).

,sxyst cnhfybws jib,jr

gthde. jxthtlm, z gjdtlf. dfv j njv, xnj vj;yj bpvtybnm cnhfybwe jib,jr. .t. nt cnhfybws, rjnjhst dslf.ncz ghb jib,rt (yfghbvth 404 fqk yt yfqlty) vj;yj yfcnhjbnm gjl lbpfqy. levf. e rf;ljuj dt,-lbpfqythf d ukfpf[ pfujhtkfcm vsckm, j njv xnj vj;yj gjl cdjq lbpfqy, yf cdjv ajyt c ghbcencndbtv dfituj vty. b kjuj, yfgbcfnm 404 ,jkmibvb rhfcysvb ,erdfvb, xnj,s rf;lsq edbltk 'nj. e djn b ghbcnegbv. bcntvf nfrjdf: ErrorDocument yjvth jib,rb /file.html jgecnbv vs [jnbv bpvtybnm 404-e. jib,re, njulf gbitv cktle.ott: ErrorDocument 404 /notfound.html ult notfound.html - afqk, rjnjhsq kt;bn d rjhytdjv rfnfkjut b bpvtyty yfvb! ckb ;t afqks c jib,rfvb kt;fn d gfgrt /errorpages nj gbitv d afqkt .htaccess ErrorDocument 404 /errorpages/404.html.

jn cgbcjr cfvs[ xfcns[ jib,jr:

401 - Authorization Required

400 - Bad request

403 - Forbidden

500 - Internal Server Error

404 - Wrong page bkb File Not Found

jplftv afqks cj dctvb 'nbvb jib,rfvb, b gbitv 'nj d afqk .htaccess.

cktle.otq xfcnb z hfccrf;e ghj lheubt aeyrwbb afqkf .htaccess, xnj,s ekexibnm cdjq cfqn.

fphtibnm/fghtnbnm jghtltktyysv IP flhtcfv r d[jle.

yjulf, ,sdftn jxtym ye;yj, xnj,s cnhfybwe dbltkb njkmrj dfib lhepmz bkb pyfrjvst c gjcnjzyysv IP flhtcjv. nj vj;yj bcgjkmpjdfnm rfr juhfybxtybt lkz gjkmpjdfntktq, (vjk only for members ajhev), yj tckb ds [jnbnt pfghtnbnm ljcneg, nj c ctujlyziybvb lbyfvbxysvb IP flhtcfvb, e dfc vfkj xtuj gjkexbncz.

s vj;tnt pf,kjrbhjdfnm ljcneg cktl. j,hfpjv:

deny from 000.000.000.000

ult 000.000.000.000 'nj IP flhtc.

nj,s hfphtibnm ljcneg ljcneg, yflj dgbcfnm:

allow from 000.000.000.000

ult 000.000.000.000 'nj IP flhtc.

ckb ds [jnbnt pfghtnbnm ghjcvjnh dctv gjkmpjdfntkzv, nj yflj dgbcfnm:

deny from all

j dct ;t, d lbhtrnjhbb rjnjhe. ds jn dct[ pf,kjrbhjdfkb, vj;yj ,eltn bcgjkmpjdfnm crhbgns.

tlbhtrn.

lyf bp cfvs[ gjktpys[ aeyrwbq .htaccess, 'nj htlbhtrn (redirect). jzcyz., rjulf gjkmpjdfntkm ltkftn pfghjc yf afqk (c flhtcf r ghbvthe www.serv.ru/test.txt), nj jnj,hf;fnmcz ,eltn cjlth;bvjt afqkf yf rjnjhsq vs gjcnfdbv htlbhtrn... .t. ltkfz pfghjc yf jlby afqk, gjkmpjdfntkm gjkexbn lheujq afqk, rjnjhsq vj;tn yf[jlbnmcz rfr b yf dfitv cthdtht nfr b yf xe;jv cfqnt. frbv ;t j,hfpjv gjxnb hf,jnf.n ,jkmibycndj htlbhtrnjd d bynthytnt.

nfr, hfccvjnhbv ghbvth:

Redirect /location/from/root/file.ext http://www.serv.ru/new/file/location.xyz

/location/from/root/file.ext - 'nj genm lj rjhytujuj afqkf (lj ye;yjuj afqkf).

http://www.serv.ru/new/file/location.xyz 'nj vtcnj, relf gjgfltn gjkmpjdfntkm cltkfd pfghjc yf afqk file.txt.

ckb afqk kt;bn d rjhytdjv rfnfkjut, nj dvtcnj location/from/root/ vj;yj chfpe gjcnfdbnm:

/oldfile.html

ye b tckb afqk d ce,rfnfkjut, nj ,eltn dsukzlbnm nfr:

/old/oldfile.html

s nfr;t vj;tnt jceotcndkznm htlbhtrn yf wtke. gfgre. jgecnbv e dfc yf cthdtht tcnm gfgrf oldfolder b ds [jnbnt xnj,s gjkmpjdfntkm gtht[jlbk d newfolder gj cjdctv lheujve flhtce.

Redirect /oldfolder http://www.serv.ru/newfolder

tgthm, tckb xtkjdtr cltkftn pfghjc yf afqk www.oldserv.ru/oldfolder/images/smile.gif, nj gfgfltn yf www.serv.ru/newfolder/images/smile.gif.

nj vj;yj bcgjkmpjdfnm jxtym vjoyj, tckb evtnm rfr ltkfnm.

fobnf gfhjktv.

ot jlyf jxtym [jhjifz aeyrwbz .htaccess, cjcnjbn d njv, xnj vj;yj ltkfnm cnhfybws gjl gfhjktv. jytxyj ceotcnde.n tot Javascript b nl, dfhbfyns, yj xthtp .htaccess 'nj cfvsq ,tpjgfcysq dfhbfyn. nj,s cjplfnm lbhtrnjhb. gjl gfhjktv, yflj dsgjkmybnm ldf ifuf. thdsq ifu cjcnjbn bp lj,fdktybt cnhjr d .htaccess b erfpfybt pfoboftvjq lbhtrnjhbb.

AuthName "Section Name" AuthType Basic AuthUserFile /full/path/to/.htpasswd Require valid-user

fv yflj bpvtybnm lkz cdjtuj cfqnf. fghbvth, gjvtyznm Section Name yf cdj yfpdfybt (r ghbvthe - Members area).

/full/path/to/.htpasswd - gjkysq genm lj afqkf .htapasswd (j, 'njv xenm gjp;t).

ckb ds yt pyftnt gjkyjuj genb, nj j,hfnbntcm r cbcntvyjve flvbybcnhfnjhe.

fqk .htpasswd

nj,s pfobnbnm lbhtrnjhb. gfhjktv, yflj gjnhfnbnm ytvyjuj ,jkmit dhtvtyb, xtv yf lheubt aeyrwbb .htaccess, gjnjve xnj dfv nfr;t yflj cjplfnm afqk cjlth;fobq username's b password's rjnjhsv hfphtityj ,eltn gjctofnm cfqn. ns lfyyst yflj dgbcfnm d afqk .htpasswd. fr b .htaccess 'nj afqk ,tp bvtyb b c 8 pyfxysv hfphtitybtv. uj vj;yj gjkj;bnm d k.,jt vtcnj cfqnf (gfhjkb ,elen pfibahjdfys), yj dct ;t cjdtne. yt rkfcnm 'njn afqk d rjhytdjv rfnfkjut, jn xe;b[ ukfp gjlfkmit.

jplfybt bvty gjkmpjdfntktq b gfhjktq.

fr njkmrj ds cjplfkb cdjq .htpasswd afqk (ds vj;tnt 'nj cltkfnm d cnfylfhnyjv ntrcnjdjv htlfrnjht) ds ljk;ys dgbcfnm bvtyf gjkmpjdfntktq b gfhjkb cktl. j,hfpjv:

username:password

ult gfhjkm (password) pfibahjdfyyfz dthcbz gfhjkz. nj,s pfibahjdfnm .htpasswd afqk, dfv ye;yj ,eltn djcgjkmpjdfnmcz ujnjdsv crhbgnjv, bkb cfvjve yfgbcfnm tuj. ckb dfv ye;yj ytcrjkmrj gjkmpjdfntktq, nj gbibnt gjcnhjxyj b[. cnm lf;t crhbgns rjnjhst cke;fn vtytl;thfvb afqkf .htpasswd.

xnj lfkmit?

lfkmit djn xnj. fr njkmrj ds pf[jlbnt d lbhtrnjhb., rjnjfhz gjl gfhjktv c gjvjom. afqkf .htaccess, nj e dfc dcgksdtn pop-up jryj d rjnjhjv yflj ,eltn ddtcnb bvz gjkmpjdfntkz b gfhjkm. s nfr;t vj;tnt bcgjkmpjdfnm bvz gjkmpjdfntkz b gfhjkm yt pfibahjdsyysvb d gjkt flhtcf, xnj,s djqnb.

http://username:password@www.serv.ru/directory
dpznj c qweb.webhost.ru/publics/htaccess.html

3
  ,
:
. +7(812) 984 5721

e-mail
icq 415547094  romver  mail.ru  romverinbox.ru
1997 - 2020 romver.ru

Display Pagerank