How to remove index.php from url in codeigniter

How to remove index.php from url in codeigniter
Promote Your Content FREE!

Promote Your Contents FREE!

Promote your contents FREE, contents such as WebSites, YouTube channels, YouTube videos, Facebook, Instagram, LinkedIn, Twitter, Pinterest and many more.

Short Description

In this video it is explained how to remove index.php from the URL in codeigniter. Codeigniter removing index.php from url. Remove index.php from url in codeigniter 3. How to remove index.php in codeigniter path.

Share

Or

Category: Science & Technology
Type: YouTube

Content Details

This content was added on Promote Content at 18 Dec 2021 and got 867 visits untill now.

Long Description

To remove the "index.php" from the URL in CodeIgniter, you will need to enable URL rewriting in your web server and configure your CodeIgniter application to use "queryless" URLs. Here are the steps to do this: Enable URL rewriting in your web server: If you are using Apache, you will need to enable the mod_rewrite module. To do this, open the Apache configuration file (usually "httpd.conf") and uncomment the line that loads the mod_rewrite module (it should look like this: "LoadModule rewrite_module modules/mod_rewrite.so"). Then, create a ".htaccess" file in the root directory of your CodeIgniter application and add the following code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] If you are using nginx, you will need to create a server block in your nginx configuration file (usually "nginx.conf") and add the following code: location / { try_files $uri $uri/ /index.php?$query_string; } Configure CodeIgniter to use "queryless" URLs: Open the "config.php" file located in the "application/config" directory of your CodeIgniter application. Set the value of "$config['index_page']" to an empty string: $config['index_page'] = ''; Set the value of "$config['uri_protocol']" to "REQUEST_URI": $config['uri_protocol'] = 'REQUEST_URI'; By following these steps, you should be able to remove the "index.php" from the URL in your CodeIgniter application. You may also need to adjust your server's virtual host configuration or firewall rules to allow the new URLs to be accessed.

Related Contents