Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When a site that uses a designer DNS Cornell sub-domain  (i.e. cen.alumni.edu, homecoming.cornell.edu, etc...) needs to redirect to landing page or child pages, the following steps need to be done.

Step-by-step guide

...

 

...

  1. When the DNS will be pointed to the home page and then needs help to land on the CEN page. There are two options for the code. If you simply want to have the page go to default landing page (homecoming.cornell.edu), use option 1 and you’re done. If sub-page pointing is being used (CEN.cornell.edu), use option 2.
    1. Option 1 – default landing page (goes only to the landing page, not to any child pages)
      1. if (

        isset( $_ENV['PANTHEON_ENVIRONMENT'] ) &&

        ( 'live' === $_ENV['PANTHEON_ENVIRONMENT'] ) &&

        isset( $_ENV['PANTHEON_SITE_NAME'] ) &&

        ( 'cornell-alumni' === $_ENV['PANTHEON_SITE_NAME'] ) &&

        isset( $_SERVER['HTTP_HOST'] ) &&

        ( false !== strpos( $_SERVER['HTTP_HOST'], 'cen.cornell.edu' ) ) &&

        php_sapi_name() != 'cli'

         

        ) {

         

        $new_url = 'https://alumni.cornell.edu/connect/networking/cen/';

        header( 'HTTP/1.0 301 Moved Permanently' );

        header( 'Location: ' . $new_url );

        exit();

        }

    2. Option 2 – child page specified by url
      1. if (
        isset( $_ENV['PANTHEON_ENVIRONMENT'] ) &&
        ( 'live' === $_ENV['PANTHEON_ENVIRONMENT'] ) &&
        isset( $_ENV['PANTHEON_SITE_NAME'] ) &&
        ( 'cornell-alumni' === $_ENV['PANTHEON_SITE_NAME'] ) &&
        isset( $_SERVER['HTTP_HOST'] ) &&
        ( false !== strpos( $_SERVER['HTTP_HOST'], 'cen.cornell.edu' ) ) &&
        php_sapi_name() != 'cli'

        ) {

        $new_url = 'https://alumni.cornell.edu/connect/networking/cen/';
        header( 'HTTP/1.0 301 Moved Permanently' );
        header( 'Location: ' . $new_url . $_SERVER['REQUEST_URI'] );
        exit();
        }

    3. Make the above changes in the "cornell-alumni/config/environments/pantheon.php"
  2. If the traffic comes from a new domain/subdomain, connect the domain in the Pantheon dashboard:
    1. Image Added
  3.  Add redirects in "Safe Redirects Manager" – (NOTE: This step is only for using the "Option 2" code above)
    1. Different types of redirects (only applies with Option 2 code):
      1. Going to the landing page:
      2. Go to a specific child page
      3. Using the search feature in alumni.cornell.edu
      4. Non-AAD URLS

  4. Request DNS change
    1. Work directly with Hostmaster@cornell.edu to schedule. Once you enter the domain info into the Pantheon dashboard for the Live/Production area, it will give you the new destination DNS info from there and send that along to Hostmaster.

...

That DNS can change to point to the Pantheon Test instance (you need to update the Pantheon dashboard to include the new domains), and then test there before making the DNS switch for CEN prod.

 

 

Info

Content by Label
showLabelsfalse
max5
spacesaadigital
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel in ("redirect","child-pages") and type = "page" and space = "aadigital"
labelsredirect child-pages

...