Setup site with Babel for HTTPS

Hi Everyone,

I have a site running, mobilisation.nl that is multi lingual with babel. I’m experiencing two problems. The first is that I can not get it to work with friendly urls and the second, and most important, is that I am unable to get this site working on HTTPS. How should I setup my htaccess file for the use of friendly urls and to get the site working with HTTPS?

Can anybody help me?

Thanks in advance, Reyn

1 Like

Welcome to the community! :slight_smile:

To always redirect from http:// to https:// you need the following code in your htaccess:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

For the Friendly URLs, you need to remove the # from the respective part which is already in the default .htaccess in your root:

# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

There’s also a System Setting regarding the FURLs, which you’ll need to activate.

You can find more help in the docs, too!

1 Like

Hi @reynier,

What is the context router you are using? With Xrouting you don’t need to touch on the htaccess file, except uncomment the friendly urls part just like on the simple install with 1 context.

Babel with Xrouting allows you to do what you need and having friendly urls working fine.
You need to be aware of the context configs for base url, site url, base path, locale, etc.

1 Like

Hi vibedesign,

I have done that. After a while I found out that I also needed to remove the [[++site_url]] from my links to eg. the stylesheets () and replace it with “https://site-name.com/…”

I suspect this is a work around in some kind of way because I do not have this problem with other sites using SSL certificates. Would it be possible that Babel is conflicting somewhere, or do I miss a system setting?

In any case: Thanks for the help!

Regards,

Reyn

1 Like

I don’t think that’s necessary, as stated in this older thread (last post).
Do you have the base href set in your templates and if so, is it any different than this:

<base href="[[!++site_url]]" />

I haven’t used Babel yet, so I unfortunately can’t help if the issue origins there…

1 Like

You might find this useful: Switching website from http to https

Thanks everybody! With your help my problems have been solved.
The entire site works well with SSL now, although I did have to remove a considerable amount of links to http:// that the editor hardcoded in the content.

Case closed!

2 Likes