Mod_rewrite 규칙 모든 도메인을 커버합니다
-
03-07-2019 - |
문제
상자에 요청 된 도메인에 다시 쓰기 화재가 발생할 수있는 방법이 있습니까? 예를 들어, 나는 그들에게 정확히 동일한 재 작가를 적용 할 수있는 5 개의 가상 호스트가 있으며 현재 각 VirtualHost 지시문은 규칙이 있지만,이를 '글로벌'어딘가에 넣을 수 있도록이를 쉽게 넣을 수 있습니까?
해결책
아니요, 두렵지 않습니다
다른 팁
You can, but it is somewhat of a hack. Create your RewriteRule in a .htaccess somewhere like:
/www/redirects/global/.htaccess
Now just set the DocumentRoot for your virtualhosts to /www/redirects/global/ and every request will be forced through your RewriteRule's.
I haven't tested it, but the mod_rewrite docs say that RewriteRule can be used in the server config context.
You may also want to look up how RewriteMaps work. Since these are a file, they could be considered to be a "global" source, but there are limitations on them since they are primarily static.