0

I have a project deployed in cloud foundry(Pivotal Web Services). It has given domain name as appname.cfapps.io. I want to change the cloud foundry URL to my custom domain. So i registered a domain in namecheap.com. Then added my site in cloudfare and then added two DNS names of cloudfare to my namecheap account.

Then i used below three commands to redirect my new domain to cloud foundry domain.

$cf create-domain myorg mydomain.com 
$cf map-route myapp mydomain.com -n myapp
$cf map-route myapp mydomain.com -n www

Now, my new domain name is redirecting to cloud foundry domain name. But the issue is after entering my new domain name, it is redirecting to my website but my URL is getting changed from "My new domain name" to "appname.cfapps.io"

Any help is appreciated.

1 Answers1

0

What kind of records do you have in Cloudflare and where do they point to? I have the same setup for one of my sites and I used two CNAME records and it all works just fine. Cloudflare CNAME records

Dan Higham
  • 3,974
  • 16
  • 15
  • Thank you @Dan for your answer. I did not point my new domain to cfapps.io like you did in the above image. I just added my site and it showed CNAME and i used the default ones. Now, I have changed my records like above, i have pointed my new domain to the previous cfapps.io domain but now when i enter my new domain, then it is showing "404 Not Found: Requested route ('my domain') does not exist". – StackOverflow Asker May 13 '20 at 17:48
  • It's working after making changes like yours. In the before comment, i have mentioned that it was not working but i figured out it was because i have not added page rules in cloudfare. Now, it's working fine. Thank you @Dane – StackOverflow Asker May 13 '20 at 19:24