Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 296
Ionut Flavius Pogacian Avatar asked Feb 26 '13 07:02

Ionut Flavius Pogacian


People also ask

How do I start Yii Framework?

Download the archive file from yiiframework.com. Unpack the downloaded file to a Web-accessible folder. Modify the config/web. php file by entering a secret key for the cookieValidationKey configuration item (this is done automatically if you are installing Yii using Composer):

What is URL rule?

A URL rule is a class implementing the yii\web\UrlRuleInterface, usually yii\web\UrlRule. Each URL rule consists of a pattern used for matching the path info part of URLs, a route, and a few query parameters. A URL rule can be used to parse a request if its pattern matches the requested URL.


1 Answers

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

RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
like image 71
sanj Avatar answered Dec 07 '22 08:12

sanj