답변 4개
채택된 답변
+20 포인트
아래와 같은 형식으로 B도메인과 그에 따른 자릿수 지정과 이동할 주소 지정해주세요.
<script type="text/javascript">
if(document.URL.substring(0,21)=="http://www.sir.co.kr/") window.location='https://sir.kr';
if(document.URL.substring(0,17)=="http://sir.co.kr/") window.location='https://sir.kr';
</script>
nginx
Copy
server { server_name .b.com; rewrite ^ http://a.com$request_uri? permanent;}# or on any version 0.9.1 or higherserver { server_name .b.com; return 301 http://a.com$request_uri;}
apache
Copy
Options +FollowSymLinksRewriteEngine OnRewriteBase /RewriteCond %{HTTP_HOST} ^b\.com$ [NC]RewriteRule ^(.*)$ http://a.com [R=301,L]
답변을 작성하려면 로그인이 필요합니다.