Changes between Version 9 and Version 10 of faq/domain/canonical-web-address


Ignore:
Timestamp:
Apr 10, 2019, 11:12:14 AM (4 months ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • faq/domain/canonical-web-address

    v9 v10  
    44= I have multiple domain names that point to my web site - how to I make it so my preferred domain always appears in the browser address bar? =
    55
    6 Many of us have multiple domain names that point to the same web site. For example, you can access our web site by going to `mayfirst.org`, or `www.mayfirst.org`, or `www.people-link.net`, etc.
     6Many of us have multiple domain names that point to the same web site. For example, you can access our web site by going to `example.org`, or `www.example.org`, or `www.example.net`, etc.
    77
    8 However, we want people to always see `mayfirst.org` in the address bar of the browser.
     8However, we want people to always see `example.org` in the address bar of the browser.
    99
    10 We do that by adding the following lines to the Web Config settings in the [https://members.mayfirst.org/cp Members Control Panel]:
     10We do that by adding the following lines to the Web Config Settings in the [https://members.mayfirst.org/cp Members Control Panel] (click the Show Advanced Settings button to access the Settings field):
    1111
    1212{{{
    13 RewriteEngine On
    14 RewriteCond %{HTTP_HOST} !^example\.org$ [NC]
    15 RewriteCond %{HTTP_HOST} !^$
    16 RewriteRule ^/(.*) http://example.org/$1 [L,R]
    17 }}}
    18 
    19 You can do the same by replacing `example.org` with the domain name you want your web site to display in the address bar of the browser. Be sure to place these lines outside of the <Directory> </Directory> section of your web configuration (if it existed), not within it; otherwise, the rewrite rules won't work.
    20 
    21 The [https://httpd.apache.org/docs/2.4/rewrite/avoid.html Apache docs] suggest the above should now be done using an If statement and Redirect rule as written below.
    22 {{{
    2313<If "req('Host') != 'example.org'">
    24     Redirect "/" "http://example.org/"
     14    Redirect "/" "https://example.org/"
    2515</If>
    2616}}}
    2717
     18You can do the same by replacing `example.org` with the domain name you want your web site to display in the address bar of the browser. In this example, we are redirecting to an https site - be sure to enable https in the control panel if you are redirecting to an https site. Otherwise, redirect to http://example.org instead.
    2819
    2920==  What if I want to force visitor of my website to use HTTPS?==
    3021
    31 You can add the following lines to the Web Config settings in the [https://members.mayfirst.org/cp Members Control Panel]:
    32 
    33 {{{
    34 RewriteEngine On
    35 RewriteCond %{HTTPS} !=on
    36 RewriteRule ^/(.*) https://example.org/$1 [L,R]
    37 }}}
    38 
    39 The [https://httpd.apache.org/docs/2.4/rewrite/avoid.html Apache docs] suggest the above should now be done using a simpler Redirect rule as written below.
    40 {{{
    41 Redirect "/" "https://www.example.org/"
    42 }}}
     22In the Advanced section of the web congiration in the [https://members.mayfirst.org/cp members control panel], there is a checkbox called "Redirect http" - ensure it is configured to redirect http traffic to https. You must enable https for this redirect to work.