0

I'm unable to remove file extension from my URL

https://www.deemsolar.com/ar/index.php

This is the current URL of my website

I want to change this as https://www.deemsolar.com/ar/

Please Help me out?

  • 6
    Possible duplicate of [CodeIgniter removing index.php from url](https://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url) – NID Feb 14 '19 at 11:30
  • 1
    Possible duplicate of [Remove index.php from url in CodeIgniter 3](https://stackoverflow.com/questions/38477720/remove-index-php-from-url-in-codeigniter-3) – Yadhu Babu Feb 15 '19 at 04:17

4 Answers4

2

Add this in your .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Note: make sure that in config.php file,

$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
Darpan Patel
  • 317
  • 2
  • 11
0

You can remove using:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
Ashu
  • 1,317
  • 2
  • 9
  • 24
0

Read the docs fully and clearly. codeigniter urls docs

vicky
  • 137
  • 3
  • 14
0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# For Index
RewriteRule ^index.extension?$ /index.php [NC,L]

# For Another Page
RewriteRule ^login.extension?$ /login.php [NC,L]