Cov txheej txheem:

Kuv yuav sau ib lub cav Apache li cas?
Kuv yuav sau ib lub cav Apache li cas?

Video: Kuv yuav sau ib lub cav Apache li cas?

Video: Kuv yuav sau ib lub cav Apache li cas?
Video: Data Science with Python! Analyzing File Types from Avro to Stata 2024, Kaum ib hlis
Anonim

Qhib lub davhlau ya nyob twg thiab ntaus ntawv a2enmod sau dua tshiab , Nws yuav pab tau koj mod_rewrite module rau Apache . Tom qab ntawd mus rau /etc/apache2/sites-available thiab kho cov ntaub ntawv default. (Rau qhov no koj yuav tsum muaj ntawv tso cai rau cov ntaub ntawv no thiab cov chaw-muaj cov ntawv tais ceev tseg.) Ua kom huv URL kuaj dua thiab lub sijhawm no nws yuav dhau mus.

Tom qab ntawd, kuv yuav rov sau dua Apache module li cas?

Qhib lub davhlau ya nyob twg thiab ntaus ntawv a2enmod sau dua tshiab , Nws yuav pab tau koj mod_rewrite module rau Apache . Tom qab ntawd mus rau /etc/ apache 2 /sites-muaj thiab kho cov ntaub ntawv qub. (Rau qhov no koj yuav tsum muaj ntawv tso cai rau cov ntaub ntawv no thiab cov chaw-muaj cov ntawv tais ceev tseg.) Ua kom huv URL kuaj dua thiab lub sijhawm no nws yuav dhau mus.

Ib sab saum toj no, txoj cai rov sau dua $1 yog dab tsi? Cov $1 yog qhov tseem ceeb ntawm cov ntsiab lus ntawm txhua yam ntawm qhov pib thiab qhov kawg ntawm txoj hlua. Hauv lwm lo lus, $1 = (.*). Hauv koj sau dua tshiab , lub ^ taw qhia qhov pib ntawm txoj hlua, tus (. Yog li, qhov yooj yim, nws hais tias rub txhua yam ntawm qhov pib mus rau qhov kawg ntawm txoj hlua thiab muab tus nqi ntawd rau $1.

Hauv qhov no, kuv yuav kuaj xyuas li cas yog tias rov sau dua module tau qhib?

17 Teb

  1. Txhawm rau xyuas yog tias mod_rewrite module tau qhib, tsim cov ntaub ntawv php tshiab hauv koj lub hauv paus nplaub tshev ntawm koj WAMP server.
  2. Nkag mus rau koj cov ntaub ntawv tsim los ntawm koj tus browser.
  3. Ctrl F los qhib kev tshawb nrhiav.
  4. Yog tsis yog, qhib
  5. Tshem lub phaus ('#') kos npe rau ntawm qhov pib thiab txuag cov ntaub ntawv no.
  6. Rov pib koj lub apache server.

a2enmod rewrite ua dab tsi?

ib 2enmod ib tsab ntawv uas tso cai rau lub module teev nyob rau hauv lub apache2 configuration. Nws ua qhov no los ntawm kev tsim symlinks hauv /etc/apache2/mods-enabled. Ib yam li ntawd, a2dismod disables ib module los ntawm tshem cov symlinks.

Pom zoo: