맨손으로 뼈를 프론트 컨트롤러를 만들려고 WAMP 환경에서 일하고 내 프로젝트 루트에서 .htaccess 파일을 만드는 것으로 시작했습니다. (예 : www/molecule/.htaccess 포함 :WAMP 아파치 다시 쓰기 문제 .htaccess
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
# Rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php
이 가
아파치 rewrite_module 내 WAMP 설정에서 사용 가능하고, 값을 httpd.conf에서 또한 주석,하지만 난 디렉토리에 그 htaccess로 어떤 페이지를로드하려고하면 내부 서버 오류를 얻고있다. 아파치 오류 로그 읽기 :
[alert] [client 127.0.0.1] C:/wamp/www/molecule/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
바른 길?
폴더 구조로 질문을 업데이트하십시오. .htaccess 파일이 서버 "www/front_controller_test"의 루트에 있음을 말하고 있지만, "C :/wamp/www/molecule /"를 나타내는 오류 메시지가 있습니다. 루트 폴더 란 무엇이며 .htaccess 파일은 어디에 있습니까? – Brad
오른쪽, Thx. 분자 였어. 폴더 구조는 www/molecule/index.php & www/molecule/.htaccess – shotdsherrif
이고 http : // localhost가 해당 폴더에서 찾을 수 있도록 해당 폴더를 가리키는 웹 서버 (또는 가상 호스트)의 "루트"입니다 , 또는 http : // localhost/molecule?을 입력해야합니까? [RewriteBase] (http://stackoverflow.com/questions/2137492/why-is-rewritebase-neccesary-when-rewriting-url-via-htaccess)를 추가해야하는지 여부에 대한 몇 가지 논쟁이있는 것으로 보입니다. 또한이 질문을해야합니다 ... 서버를 다시 시작 했습니까? – Brad