https://github.com/aasif-iqbal/remove-index.php-from-url-in-codeigniter
Removing index.php makes the URL look cleaner and professional.
https://github.com/aasif-iqbal/remove-index.php-from-url-in-codeigniter
Last synced: about 2 months ago
JSON representation
Removing index.php makes the URL look cleaner and professional.
- Host: GitHub
- URL: https://github.com/aasif-iqbal/remove-index.php-from-url-in-codeigniter
- Owner: aasif-iqbal
- Created: 2021-06-27T04:35:02.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T06:33:56.000Z (almost 4 years ago)
- Last Synced: 2025-01-18T09:34:18.762Z (3 months ago)
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Remove-index.php-from-URL-in-CodeIgniter
1. Create a .htaccess file in our project’s root directory or CodeIgniter directory.
```php
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
```2. Removing index.php file
- Open the config.php file in your text editor and remove index.php from here.###### Change:
```
$config['index_page'] = "index.php";
```###### To:
```
$config['index_page'] = ''
```###### Also Change:
```
$config['uri_protocol'] = "AUTO";```
###### To:
```
$config['uri_protocol'] = "REQUEST_URI";
```3. Restart Apache Web Server (XAMPP)
