Forums

Redirection and ssl

I connected my domain to cloudflare, then created a DNS record (from within my cloudflare) to connect it to my pythonanywhere space, using cname. It works good but i still have 2 issues: 1) my app is visible via www.mydomain.com, when users try to reach it via mydomain.com they get a blank page because there is no auto redirection to www.mydomain.com. Can this be done via my cloudflare dashboard? if so - how exactly? or perhaps its possible to create such an auto redirection via my pythonanywhere account? if so - how? 2) In my pythonanywhere dashboard I enabled the "force https" option, and yet, if i try to visit the site via HTTP://www.mydomain.com it does not force https, how to solve it? I already read your redirection guide, i could not find a solution there. And no, i am not interested at 3rd party solution for such thing! So to make it clear: I need that 1) the domain will always be forced to https 2) the domain will always auto redirect to https://www.mydomain.com, REGARDLESS if the user tried to reach it via HTTP://mydomain.com or https://mydomain.com Thanks!

It looks like you've put your site on www.yourdomain.com on PythonAnywhere now, so it looks like things have moved on.

Yes, you should set things up so that yourdomain.com redirects -- both for HTTP and HTTPS -- to www.yourdomain.com on Cloudflare. We don't have instructions for that, because they're a separate company and make changes to their interface regularly, but if you google for "cloudflare domain redirect" you should be able to find up-to-date instructions on their site.

Thanks, you did not answer my https force question.

In my pythonanywhere dashboard I enabled the "force https" option, and yet, if i try to visit the site via HTTP://www.mydomain.com it does not force https, how to solve it?

Regarding redirection via cloudflare, i need the IP number of my pythonanywhere in order to set A record for the redirection rule. where can I find it?

Looks like it was not reloaded after that change, but now it was and it's forcing https.