Monthly Archives: June 2013

Remove index.php from Codeigniter url

To remove “index.php” from codeigniter url

Open application/config/config.php file and look for following section in the file

Remove the index.php and save the file

Now create an .htaccess file and paste  following lines

Save this file into root directory of your project, after creating this file restart your web server.

Set,Read & Delete Cookie in Jquery

Recently in one of my project, I happened to use Cookie in Jquery. So, I though it would helpful for future references and to others also.

To set, read and delete cookie in Jquery I found this plugin very useful, you can download this from here,

http://plugins.jquery.com/cookie/

First include this plugin on your page by

To set a cookie

first parameter is the name of the cookie, which we will use further to read / delete, second parameter is the value for this cookie.

If we want a cookie to get expire after a time interval, we do this by setting time limit

Now this cookie will get expired after 5 days.

To read a cookie’s value, just pass the cookie name

To delete a cookie

Redirect website to https from cpanel or htaccess file or php

If you want to redirect using htaccess, add following lines in the htacess files

We can also redirect  using php code in out header file

To redirect from cPanel,

Log into your websites control panel, then go to “Domains” section. Click on “Redirects” option

– Select type “Permanent (301)” from dropdown menu

– Select domain name which you want to redirect

– And finally enter the url to which you want the above select domain redirect to