Learn about Centmin Mod LEMP Stack today
Register Now

Domains DNS Cloudflare Cloudflare page rules

Discussion in 'Domains, DNS, Email & SSL Certificates' started by Jon Snow, Nov 3, 2019.

  1. Jon Snow

    Jon Snow Active Member

    518
    72
    28
    Jun 30, 2017
    Ratings:
    +114
    Local Time:
    11:42 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    Anyone use cloudflare page rules before for the sole purpose of domain redirecting?

    Can it redirect domain.com to new-domain.net?

    Or domain.com/* to new-domain.net/*
    Keeping in mind that "*" is a substitute for whatever pages of the domain like domain.com/test.php?
     
  2. rdan

    rdan Well-Known Member

    4,942
    1,180
    113
    May 25, 2014
    Ratings:
    +1,789
    Local Time:
    10:42 AM
    Mainline
    10.2
  3. Jon Snow

    Jon Snow Active Member

    518
    72
    28
    Jun 30, 2017
    Ratings:
    +114
    Local Time:
    11:42 PM
    Nginx 1.13.9
    MariaDB 10.1.31
  4. rdan

    rdan Well-Known Member

    4,942
    1,180
    113
    May 25, 2014
    Ratings:
    +1,789
    Local Time:
    10:42 AM
    Mainline
    10.2
    Like this

    upload_2019-11-4_2-36-3.png
     
  5. Jon Snow

    Jon Snow Active Member

    518
    72
    28
    Jun 30, 2017
    Ratings:
    +114
    Local Time:
    11:42 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    @rdan Do I need to set up any DNS records in Cloudflare? The page rule isn't working and the domain just goes to a browser page saying the site cannot be reached.

    This site can’t be reached
    domain.com’s server IP address could not be found.

    DNS_PROBE_FINISHED_NXDOMAIN
     
  6. rdan

    rdan Well-Known Member

    4,942
    1,180
    113
    May 25, 2014
    Ratings:
    +1,789
    Local Time:
    10:42 AM
    Mainline
    10.2
    DNS must be setup, Cloudflare or outside.
     
  7. Jon Snow

    Jon Snow Active Member

    518
    72
    28
    Jun 30, 2017
    Ratings:
    +114
    Local Time:
    11:42 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    The domain is pointing to Cloudflare's nameservers but I don't have anything on the DNS page in Cloudflare.
     
  8. rdan

    rdan Well-Known Member

    4,942
    1,180
    113
    May 25, 2014
    Ratings:
    +1,789
    Local Time:
    10:42 AM
    Mainline
    10.2
    Setup A records.
     
  9. Jon Snow

    Jon Snow Active Member

    518
    72
    28
    Jun 30, 2017
    Ratings:
    +114
    Local Time:
    11:42 PM
    Nginx 1.13.9
    MariaDB 10.1.31
    To point to what?

    Basically I don't have a server for this domain. I wanted to know if I could redirect through Cloudflare alone.
     
  10. rdan

    rdan Well-Known Member

    4,942
    1,180
    113
    May 25, 2014
    Ratings:
    +1,789
    Local Time:
    10:42 AM
    Mainline
    10.2
    Yes you can, just use any random IP, and be sure to enable Cloudflare Orange cloud, page rule should work.
     
  11. deltahf

    deltahf Premium Member Premium Member

    361
    170
    43
    Jun 8, 2014
    Ratings:
    +277
    Local Time:
    10:42 PM
    I am doing this with many domains in Cloudflare.

    Just add a single DNS record with '@' as the name and then point it to an un-routable IP address (so you know it will never resolve to another site in case you misconfigure something in the future). I use 192.0.2.1. Then activate the page rule that rdan shared above, and you are all set. :)