일부 IP를 제외한 모든 사용자가 전체 사이트에 대한 액세스를 거부해야합니다. 또한, 나는 모든 사람을위한 사이트 하나 개의 폴더에 대한 액세스를 허용해야합니다mod_rewrite에서 복잡한 조건을 만드는 방법은 무엇입니까?
Options +FollowSymLinks
Options +Indexes
RewriteEngine on
# Allow access only for devs
RewriteCond %{REMOTE_ADDR} !10.10.10.10 [NC] # First dev id
RewriteCond %{REMOTE_ADDR} !11.11.11.11 [NC] # Second dev id
# Allow direct access to files
RewriteCond %{REQUEST_FILENAME} !-f
# Redirecting guests
RewriteRule (.*) /coming/soon/index.html [R=307]
# But where to place this condition?
RewriteRule ^/?preview/?$ /preview/index.html [NC]
# Other rules for main site structure
# ...
그래서, 난 단지 DEVS의 전체 사이트 로딩이 필요합니다. 다른 사용자 (손님)는 /coming/soon/
페이지 을 볼 수 있으며 게스트는 /preview/
페이지를 볼 수 있습니다.
어떻게 하시겠습니까? 당신의 /preview/
재 작성 모든 사용자에게 적합 이후 재 작성 규칙에 의존하지 않는 경우
감사합니다. 첫 번째 아이디어는 매우 간단하고 작동합니다 =) –