isapi_rewrite를 사용한 url_rewriting
-
05-07-2019 - |
문제
Isapi_rewrite 3에 문제가 있습니다.
A와 같은 URL이 있습니다
www.example.com/web/index.html?ag=2154
내가 원하는 것은 사용자 가이 주소를 작성할 때 에이전트의 하위 도메인으로 변환되어야합니다.
www.2154.example.com/web/index.html?ag=2154
미리 감사드립니다
해결책
주소 표시 줄의 URL이 변경되기를 원하십니까? 아니면 "무대 뒤에서"변환되기를 원하십니까? 중 하나를 시도하십시오
RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,L]
또는
RewriteBase /
RewriteCond %{QUERY_STRING} ^ag=(\d+)$ [NC]
RewriteRule ^web/index\.html$ http://www.%1.example.com%{REQUEST_URI} [NC,P]
제휴하지 않습니다 StackOverflow