Back to Question Center
0

Semalt: Kumaha ngagunakeun .htaccess nulis balik aturan ngaleupaskeun .php jeung polder tina URL?

1 answers:

Kuring nyoba simplify nu URL ngagunakeun kaayaan nulis balik jeung aturan on ramatloka WAMP lokal kuring. Contona Abdi hoyong gaduh / ProjetSyntheseFAC / mammiferes tinimbang / ProjetSyntheseFAC / Kaca / animaux / mammiferes. php - scripts prontos gratis.

Kuring kudu ngaleupaskeun polder tina URL tur pupus ". php "ti tungtungna. Sagalana Kuring geus diusahakeun boh henteu dianggo atanapi ngahasilkeun kasalahan server internal.

Di dieu aya hirarki folder kuring:

     / wwww / Project SynthesiA /:
- indéks. php
-. htaccess
- Kaca:- animaux:- mammiferes. php- oiseaux. php- réptil. php- infos:- aksés. php- kontak. php- rarancang. php- tontonan:- reserverPlace. php- tontonan. php`    

Di dieu aya naon atuh diusahakeun panungtungan:

     RewriteEngine Dina
RewriteRule ^ mammiferes $ / Kaca / animaux / mammiferes. php    

jeung

     RewriteEngine Dina
RewriteCond% {ENV: REDIRECT_STATUS}. [OR]
RewriteCond% {REQUEST_FILENAME} -f
RewriteRule ^ - [L]
RewriteCond% {REQUEST_URI} / (. +)
RewriteRule! \. [A-z0-4] {2,4} $ / Kaca / animaux /% 1. php [NC, L]
RewriteRule (. *) / Kaca / animaux / $ 1 [L]    
February 5, 2018