Question: problem with the ssl

problem with the ssl

Hi, I have tried everything to redirect all my url to https but everytime I type the url, without adding https, it goes to http

DD

David Dut

Asked
Hi,
I have tried everything to redirect all my url to https but everytime I type the url, without adding https, it goes to http
  • MS

    Mian Saleem

    Answered
    Hello, Did you update the `base_url` as mentioned in the documentation.pdf?
  • DD

    David Dut

    Answered
    but it still redirects to http unless I add https
  • DD

    David Dut

    Answered
    even the $config['cookie_secure'] I set it to TRUE
  • MS

    Mian Saleem

    Answered
    Hello,

    If `base_url` is already set to `https` then the issue would be due to your server config. You can check this [SO FAQ](https://stackoverflow.com/questions/16200501/http-to-https-apache-redirection)

    You can edit your .htacess file to redirect http to https

    ```
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]
    ```

    Thank you
  • DD

    David Dut

    Answered
    Thank you. This resolved the issue
  • DD

    David Dut

    Answered
    Actually wait, it did not work. The page now is redirected to https but looks all messed up
  • DD

    David Dut

    Answered
    It now looks like this
    Attachments
  • MS

    Mian Saleem

    Answered
    Hello,

    You just need to refresh the page. All the static contents should be loaded from https as your base_url. May be you can try

    ```
    RewriteEngine On
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://yourdomain.com/$1 [R,L]
    ```

    You should check with your host as they might be able to check and guide you.

    Thank you
  • DD

    David Dut

    Answered
    I found the problem, I needed to configure 000-default-le-ssl.conf . I just did that and now it works fine
  • DD

    David Dut

    Answered
    Is there a way to remove the cookies?
  • Login to Reply