Website redirection issue

#1

My domain is:www.jernal.com

The operating system my web server runs on is (include version):Amazon linux

I can login to a root shell on my machine (yes or no, or I don’t know):yes

Hi guys,

Today , I have an issue with my website , when I typed www.jernal.com ,it would wait for some seconds ,and the redirects it to jernal.com, do anyone know this reason ?

#2

What webserver are you using?

sudo ss -tlnp | grep -E ":(80|443)"
#3

Hi _az,

I am using appache-tomcat,
]# sudo ss -tlnp | grep -E “:(80|443)”
LISTEN 0 100 :::80 :::* users:((“java”,pid=8458,fd=50))
LISTEN 0 100 :::443 :::* users:((“java”,pid=8458,fd=59))

#4

The redirect would be coming from your Tomcat configuration then.

Perhaps take a look at this article to familiarize yourself with how it can be done, and you can search for similar changes in your own configuration: https://www.inmotionhosting.com/support/community-support/general-information/apache-tomcat-85-http-80-to-https-443-redirect-howto

There’s a chance if you are using ELB/ALB that one of those is doing it too, worth checking.

#5

Actually, I am not using ELB/ALB. And 80 ,443 port is opening , I just don’t know why www.jernal.com can be redirected to jernal.com , I have not changed tomcat configuration file ,it didn’t have this issue for the passwd days .

#6

Edit: I just realized that http://www.jernal.com/ doesn’t redirect to http://jernal.com/ for me.

Perhaps it is a browser caching issue on your side.

$ curl -X GET -I -L http://www.jernal.com/
HTTP/1.1 302
Cache-Control: private
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Location: https://www.jernal.com/
Content-Length: 0
Date: Wed, 20 Feb 2019 05:34:13 GMT

HTTP/1.1 200
Cache-Control: private
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Accept-Ranges: bytes
ETag: W/"1930-1550632124000"
Last-Modified: Wed, 20 Feb 2019 03:08:44 GMT
Content-Type: text/html
Content-Length: 1930
Date: Wed, 20 Feb 2019 05:34:15 GMT
#7

Awsome! After I rebooted my computer , it works fine now !
this morning , I had tried 3 different browsers , but they were all redirected to jernal.com .
Finally , thanks for your help !

2 Likes
closed #8

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.