Posts

How to remove index.php from the url

Image
How to remove index.php from the url. To remove index.php from url you have to write the below code in the .htaccess file in the root(In my case root folder is  "/htdocs/Codeigniter" ) 1. Paste the code in the .htaccess file <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]  </IfModule> Note -  If you don't see any .htaccess file inside the folder then create by your own and save it as .htaccess 2. Inside the config file do the following changes $config['index_page'] = 'index.php'; to $config['index_page'] = ''; 3. If the above 2 things not working then apply the 3rd one. $config['uri_protocol'] = "AUTO"; to $config['uri_protocol'] = "REQUEST_URI"; So that's it hope you will able to remove the index.php from the url. Thanks.. Everything about email marketing

First code in php codeigniter

Image
How to run code in the framework Codeigniter. Below I have provided step by step procedure so don't worry let's begin. Step 1: Create controller code-named this file as "First.php" <?php defined ( 'BASEPATH' ) OR exit ( 'No direct script access allowed' ); class First extends CI_Controller { public function index () { $this -> load -> view ( 'first_view' ); } } Step 2: Now create a view with the name "first_view.php". <?php defined ( 'BASEPATH' ) OR exit ( 'No direct script access allowed' ); ? > <! DOCTYPE html > < html > < head > < title > Hello World </ title > </ head > < body > < p > Hello World!! </ p > </ body > </ html > Now you can run this file by giving the URL  "http://localhost/code/index.php/First" Note: here "code" is my folder name, index.php is th...