when i am redirecting my url to sub url through alias to another record in this hosted zone .while accessing it should redirected to sub url but it is giving response from same url with 200status code

0

when i am redirecting my url to sub url through alias to another record in this hosted zone .while accessing it should redirected to sub url. while curl this url i am getting 200 status code for both url. and also when i am trying to dig both url target ip is same.

when i am access both url i am getting 200 ok

curl -I "here i have given my main url" HTTP/1.1 200 OK Date: Fri, 08 Dec 2023 09:53:51 GMT Server: Apache/2.4.41 (Ubuntu) Last-Modified: Wed, 06 Dec 2023 12:39:49 GMT ETag: "e0c-60bd6a59dd7f6" Accept-Ranges: bytes Content-Length: 3596 Vary: Accept-Encoding Content-Type: text/html

and this is my sub url curl -I "sub url" HTTP/1.1 200 OK Date: Fri, 08 Dec 2023 09:54:01 GMT Server: Apache/2.4.41 (Ubuntu) Last-Modified: Wed, 06 Dec 2023 12:39:49 GMT ETag: "e0c-60bd6a59dd7f6" Accept-Ranges: bytes Content-Length: 3596 Vary: Accept-Encoding Content-Type: text/html

kishor
질문됨 5달 전165회 조회
2개 답변
0

Hello.

How do you set up redirects?

profile picture
전문가
답변함 5달 전
  • I don't think the HTTP status code will be 300 because it's not an HTTP redirect. The settings you made are mapping between domains, so I don't think it's an HTTP redirect.

  • For example, if you are using Apache as your web server, you can configure the domain to be redirected by configuring it as follows. In the example below, if the domain "www.test.com" is accessed, it will be redirected to the domain "test.com".

    <VirtualHost *:80>
      ServerName test.com
      DocumentRoot /var/www/html
    </VirtualHost>
    <VirtualHost *:80>
      ServerName www.test.com
      DocumentRoot /var/www/www/html
      RewriteEngine on
      RewriteCond %{HTTP_HOST} ^www\.test\.com$
      RewriteRule ^/(.*) http://test.com/$1 [R=301,L]
    </VirtualHost>
    
  • If you are using ALB, you can also set up redirection by following the steps in the document below. https://repost.aws/knowledge-center/elb-redirect-to-another-domain-with-alb

0

using route53 ist hosted zone ----> record---- > create record set --> their i am giving sub url and then enable alias --------> after alias to another record in this hosted zone ----> then providing the record ----> then save it

by doing this when i will access main record it should redirect to sub record and i should see 300 status code . but i am getting response from same main record not from sub record and my status code is 200

kishor
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠