Changing my base href to https

I am trying to change my base href to https and then I think I also need to change some files but I am a little confused on where to start.

I found this article telling me what I need to do but I need a little help on how.

I changed it a different way than they suggested but it will work for now. How would I go about forwarding all http urls to https

There are a number of methods. You can google : htaccess forward http to https.

One way is to put this in the .htaccess file just below the rewrite base line:

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Thank you I saw that! I am in the modx manager and I see a ht.access file but it is locked.

The ht.access file is ignored. It’s just an example. You need to modify the .htaccess file at the site root. If there isn’t one, you can rename the ht.access file to .htaccess using File Manager in cPanel (or the equivalent).

Hey @leocubs89,

MODX Cloud uses Nginx as the web server and, therefore, you’re going to actually use the Web Rules in MODX Cloud for that and apply the appropriate rules there for this. See Nginx Web Rules & Rewrites.

The bottom line is you’ll want the following code in your web rules above the main MODX rewrite:

# Tells the browser to always force SSL. 
# Do not uncomment this line if there is a chance you will turn off SSL
# add_header Strict-Transport-Security "max-age=31536000; includeSubdomains"; 

if ($host != "www.mydomain.com") {
    return 301 https://www.mydomain.com$request_uri;
}
if ($scheme != "https") {
    return 301 https://$host$request_uri;
}

Where mydomain.com is your domain. You generally will combine this with a redirect from www->non-www or vice versa (which are the first three examples on the documentation page).