How to configure Yii Framework to use HTTPS?

16,006

Solution 1

There is also a good wiki article about it on the Yii website explaining URL management for Websites with secure and nonsecure pages

The article is only usefull if you have some content that has to use HTTPS and some other HTTP. If you want everything going by HTTPS then it wont be usefull for you.

Solution 2

You don't need configure yii app, just use in .htaccess

RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
Share:
16,006
Ionut Flavius Pogacian
Author by

Ionut Flavius Pogacian

WILL.I.AM says it all

Updated on June 12, 2022

Comments

  • Ionut Flavius Pogacian
    Ionut Flavius Pogacian almost 2 years

    I just bought a SSL certificate for my website linkbook.co;

    My website is developed using the Yii Framework;

    Do I have to configure the App to use HTTPS or will the server do this for me?

    If I have to configure the App, how do I tell to the widgets, clistviews, portlets, etc, to use the HTTPS protocol?

  • Ionut Flavius Pogacian
    Ionut Flavius Pogacian about 11 years
    this should be easy; i have to wait fot the admins to install the ssl;
  • Ionut Flavius Pogacian
    Ionut Flavius Pogacian about 11 years
    i dont really want the https all the time; my website is small; but, the bookmarklet, needs https, and my website will respons as https when requested by the bookmarklet;
  • Ionut Flavius Pogacian
    Ionut Flavius Pogacian about 11 years
    i will; but this is a bigger problem, since a bookmarklet is involved; stackoverflow.com/questions/15090986/…
  • Jason G
    Jason G about 9 years
    if I go https I get a blank page if I go http i get the website. do we need to change the virtual host to listen on the other port?
  • Trober
    Trober almost 8 years
    This didn't work for me with a website on a subdomain. For example, sub1.mysite.com. I'm not on the www subdomain.