내 CMS를 구축하고 .htaccess
파일로 놀고 다니는 중입니다..htaccess 파일에 대한 변경 사항을 취소하는 방법
나는 모든 HTTP 요청에 후행 슬래시를 추가하는 코드 스 니펫을 찾고 있었다.
코드를 삽입 할 때 작업중인 서브 디렉토리의 이름도 제거된다는 것을 깨달았습니다.
URL이 :
것은 그래서이다 나는 무엇을했다 : 로컬 호스트/프로젝트/index.php에
이것은 내가 원하는 무엇인가 : 로컬 호스트/프로젝트/index.php에/
을결과는 다음과 같습니다. 로컬 호스트/index.php/
그러나 실제 문제는 다음과 같습니다. 결과를 보았습니다. 예제 3에서 예제 1로 되돌아 가고 싶습니다. 그러나 .htaccess
파일의 코드를 삭제 한 후에도 변경 사항은 그대로 남아 있으며이 문제를 되돌릴 방법이 없습니다. .
이 다시 쓰기 규칙을 되돌리려면 어떻게해야합니까?
이것은 내 .htaccess
은 "후행 슬래시"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /tesla0.2/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
이것은을 구현하기 전에 내 후 .htaccess
: I 개봉 htaccess로 파일이 "프로젝트"디렉토리에 있다고 가정
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /tesla0.2/
RewriteCond %{REQUEST_URI} !\.(php|html?|jpg|gif)$
RewriteRule ^(.*)([^/])$ http://%{HTTP_HOST}/$1$2/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}/index.html !-f
RewriteCond %{REQUEST_FILENAME}/index.php !-f
RewriteRule . index.php [L]
</IfModule>
변경 한 후에 아파치를 다시 시작 했습니까? – showdev
실제로 MAMP 서버를 다시 시작 했으므로 내 아파치도 –
'CTRL' +'Z' :) –