여기에 제가 가진 경우가 있습니다. 이미 며칠 동안 작성하는 방법에 대해 궁금해하며 너무 복잡합니다. 다음을 다시 작성하겠습니다.htaccess 동적 폴더 재 작성
http://demo.myurl.com/proevent/event1 to http://demo.myurl.com/index.php?url=proevent&path=event1
http://demo.myurl.com/proevent/admin to http://demo.myurl.com/admin - when folders exist under that location I want to have them loaded and not falling to /index.php
이제 "proevent"및 "event1"은 완전히 동적입니다!
내가 알고있는 폴더 : admin, inc, 기존 사진, 나머지는 동적입니다.
리다이렉션의 모든 경우에 어떤 경로에서 열렸는지 알고 싶거나 오류 메시지를 보내고 싶습니다. 여기
는 내가 지금까지 무엇을 가지고 :사람들과 슬래시를 넣어하는 것을 잊지 건너 뛰고 폴더가없는 그것으로 작업을 수행 할 때 모르는 또한
RewriteCond %{REQUEST_URI} !(\.|/$)
RewriteRule (.*) /$1/ [R=301,L]
if dir/file exists (doesn't really work)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ([^/]*)/(.*) /$2%{REQUEST_URI} [R]
존재 않습니다 이전 사례에 해당 될 수도 있습니다.
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]*)/(/?.*?)([^/]*)$ index.php?url=$1&path=$2 [L]
도움이 되었습니까?
가능한 [[.htaccess 다시 쓰기 규칙을 디버깅하기위한 팁] (http://stackoverflow.com/questions/9153262/tips-for-debugging-htaccess-rewrite-rules)의 중복 –