Forums

Problem with redirect from naked domain to subdomain

Hello,

Suppose I have DNS rule that redirect my example.com to www.example.com site. When I enter "example.com", automatically I get redirected to "www.example.com" which is what I want.

However, when I send GET request to inner folder, e.g. "example.com/subdir", I get 404 error, instead of redirecting to "www.example.com/subdir".

Any idea why? Thanks.

That is an issue that you will have to raise with the service that is providing the redirect. It is not something we can help with.

Thanks for your reply, I will try to be more specific:

I tried to put my website in Google Search Console, but I got a crawling error due to my robots.txt. On example.com/robots.txt I get: User-agent: * Disallow: /

Whereas on www.example.com/robots.txt I get: User-agent: * Disallow:

The second one is what is hosted on pythonanywhere, and I don't have any clue where the first one is coming from.

Any idea how can I change example.com/robots.txt? where it comes from?

Thanks.

It still looks like a question to the service that is providing the redirect. We can at least check what is hosted on Pythonanywhere if you send us more details on support@pythonanywhere.com.

I guess I will have to consider connecting my naked domain to Pythonanywhere.

Thanks!