Hiding index.php from URL path of Yii2 Advanced template

Step1: Update file frontend/config/main.php and backend/config/main.php

'urlManager' => [
'class' => 'yii\web\UrlManager',
'showScriptName' => false,
'enablePrettyUrl' => true,
'rules' => array(
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
),
],

Step2: add .htaccess file in both frontend/web and backend/web

RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
Note: Make sure mode_rewrite module is enable in apache settings.

Accepting Cross Domain Requests In Sails.Js Builtin Rest API & Custom Controller Actions

In Sails.Js By Default the cross-domain API calls are restricted but you can enable/accept JSONP calls by changing jsonp: true in config/controllers.js file.Now you are free to make the built in Sails.js API calls from any other server to your Sails.js App.

Continue reading “Accepting Cross Domain Requests In Sails.Js Builtin Rest API & Custom Controller Actions”

Integrating Imap Features Into Web App For A Gmail Mailbox

Hope you already have basic understanding of what Imap is. if not go here

Basically what i am explaining here will be a way to access mails from a gmail email mailbox into your application, save mail information to a batabase table, saving the replays, send reply from application, move certain mails to certain folders in gmail from application itself etc.

Continue reading “Integrating Imap Features Into Web App For A Gmail Mailbox”