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


Ignore:
Timestamp:
Sep 28, 2016, 2:33:24 PM (5 years ago)
Author:
JaimeV
Comment:

--

Legend:

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

    v8 v9  
    1919You 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.
    2020
     21The [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{{{
     23<If "req('Host') != 'example.org'">
     24    Redirect "/" "http://example.org/"
     25</If>
     26}}}
     27
    2128
    2229==  What if I want to force visitor of my website to use HTTPS?==
     
    2936RewriteRule ^/(.*) https://example.org/$1 [L,R]
    3037}}}
     38
     39The [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{{{
     41Redirect "/" "https://www.example.org/"
     42}}}