문제

I need to set up a subdomain to redirect to a specific URL, not another domain. I'm using cloudflare.

I tried to do this by creating an A record pointing to the IP of the server and then I created a Page Rule which redirects from my subdomain to a specific address.

Can anyone help me with this? I'm totally lost, I find information on this anywhere.

thanks

도움이 되었습니까?

해결책

Maybe it will be easier to make redirection with rewrite rules through .htaccess or virtual host configuration?

  • At Cloudflare CP: create A record for subdomain in DNS section (if you don't have * A record already)
  • At webserver: configure virtual host or/and add rewrite rules to redirect to needed URL

다른 팁

There is a fairly extensive tutorial about PageRules in our knowledge base & on our blog.

Note: You do need to make sure the DNS record is proxied in your DNS settings for it to work. Redirects won't work if the record is going direct to your server.

I suspect there's a bug on cloudflare ( I already reported it ) If you have your subdomain record in place along with orange cloud proxy active and the correct url pattern and forwarding address set and it still refuses to work, then you are experiencing the -still to be confirmed- bug.

This quick fix did the trick for me:

  1. Go to cloudflare settings.
    domain settings contextual menu on cloudflare
  2. Change the "CDN only" performance setting to "CDN + basic optimizations".
    contextual menu for performance settings and mouse indicating selection

It will start working immediately, after that you can go back to "CDN only" and it will continue to work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top