Ionut Flavius Pogacian
Ionut Flavius Pogacian

Reputation: 4811

How to configure Yii Framework to use HTTPS?

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?

Upvotes: 8

Views: 16938

Answers (3)

aidonsnous
aidonsnous

Reputation: 1503

Add these instructions in your .htaccess which must be in the public_html folder where the index.php is:

RewriteEngine On
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] 

Upvotes: 0

darkheir
darkheir

Reputation: 8950

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.

Upvotes: 1

sanj
sanj

Reputation: 444

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

RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

Upvotes: 7

Related Questions