I have two apps app1 and app2 on 000webhost. Say app1 has domain www.example.com which uses cloudflare. I want subdomain.example.com to be the main domain of app2. How can I do this?

I have created a CNAME recored in cloudflare with values Name: subdomain, Value: app2.000webhostapp.com.

I also added entry to point subdomain.example.com to app2.000webhostapp.com in 000webhost app2's site settings

But when I go to subdomain.example.com. Website is loaded correctly, but link in the browser changes from subdomain.exmaple.com to app2.000webhost.com. Its like some kind of redirection is happening. I don't want the link to change.

  • Apps can detect the host name they are served under and issue redirects to their preferred name. Many do so including WordPress which is the most popular content management system. You will likely have to configure your web app to use your new subdomain as its preferred host name. Which web app are you using? Jul 30 '18 at 12:45
  • I am using wordpress. I have tried updating the Site Url from wordpress settings. but then It does not even load. It goes into redirection loop. Jul 30 '18 at 13:51
  • Did you try clearing your browser cache after updating the site URL? That redirect loop is probably caused by a cached redirect. Jul 30 '18 at 14:01
  • Yes, I have cleared the browser cache. I have tried it in private mode too. Still It goes into redirection loop Jul 31 '18 at 1:32
  • We'll need to know more about your server configuration. It could be a virtual host that is configured to do the redirect. It could be something you have in your .htaccess file. Jul 31 '18 at 2:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.