0

I am having 2 domain EXAMPLE:- example.com and result.com both built on codeigniter. I want to redirect all urls of example.com to result.com so i redirected all the urls from cpanel of example.com to result.com.

so, when i put a url of exapmle.com/folder/xyz after when it redirect to result.com it shows :- https://result.com/index.php?folder/xyz

Is there anyway to remove the index.php? ?

bhardwaj_g
  • 35
  • 9
  • 2
    Possible duplicate of [CodeIgniter removing index.php from url](https://stackoverflow.com/questions/19183311/codeigniter-removing-index-php-from-url) – Alex Jul 16 '19 at 08:45

1 Answers1

0

Try the following

Open config.php and do following replaces

$config['index_page'] = "index.php"

to

$config['index_page'] = ""

In some cases the default setting for uri_protocol does not work properly. Just replace

$config['uri_protocol'] ="AUTO"

by

$config['uri_protocol'] = "REQUEST_URI"

.htaccess

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

Note: .htaccess code vary depending on hosting server. In some hosting server (e.g.: Godaddy) need to use an extra ? in the last line of above code. The following line will be replaced with last line in applicable case: