WAMP에서 로컬 projet에서 작업합니다. 내가 예를 들어,이 URL을 가지고 상품 URL 콘드과 규칙을 가하고 수행하려고 무엇.htaccess URL 폴더 다시 쓰기/삭제/".php"삭제
- Project :
- index.php
- .htaccess
- pages :
- animaux :
- mammiferes.php
- oiseaux.php
- reptiles.php
- infos :
- access.php
- contact.php
- plan.php
- spectacle :
- reserverPlace.php
- spectacle.php
: http://localhost/ProjetSyntheseFAC/mammiferes
대신 http://localhost/ProjetSyntheseFAC/pages/animaux/mammiferes.php
그래서 여기 내 폴더 계층 구조입니다. 그래서 URL에서 폴더를 삭제하고 끝에 ".php"를 삭제해야합니다.
내가 찾은 모든 시도가 작동하지 않거나 내부 서보 오류에 넣으십시오. 여기
내가 마지막으로 뭘하려 :
RewriteEngine On
RewriteRule ^mammiferes$ /pages/animaux/mammiferes.php
이
RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} . [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule^- [L]
RewriteCond %{REQUEST_URI} /(.+)
RewriteRule !\.[a-z0-4]{2,4}$ /pages/animaux/%1.php [NC,L]
RewriteRule (.*) /pages/animaux/$1 [L]
누군가가 나를 도울 수
//// ? 당신의.htaccess
파일이
/project/
하위 디렉토리에 위치하고 있으며, 상위 디렉토리는 문서 루트 인 경우
[가능한 답변!] (https://stackoverflow.com/questions/11243975/rewriting-url-with-htaccess-local-in-xampp) 처음 세 줄의 코드를 사용하여 자신의'RewriteRule' 이미 위에서 한 것입니다. 만약 그것이 작동한다면 시도하고, 그렇지 않다면'error_log'가 내부 서버 오류의 의미인지 확인하십시오. – RepeaterCreeper
@RepeaterCreeper URL은 여전히 동일하지 않으며 htaccess가없는 것처럼 오류도 발생하지 않습니다. – Karim