CodeIgniter Forums
how to remove index.php? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: how to remove index.php? (/showthread.php?tid=51859)



how to remove index.php? - El Forum - 05-21-2012

[eluser]Hamed[/eluser]
it is possible to remove index.php? like:
http://domain.tld/index.php/main change to
http://domain.tld/main

??


how to remove index.php? - El Forum - 05-21-2012

[eluser]InsiteFX[/eluser]
.application/config/config.php
Code:
$config['index_page'] = '';

.htaccess - may or may not work depending on your environment!
Code:
php_value default_charset utf-8

Options FollowSymLinks
DirectoryIndex index.php

RewriteEngine On
RewriteBase /

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



how to remove index.php? - El Forum - 05-21-2012

[eluser]Matalina[/eluser]
Check: http://ellislab.com/forums/viewthread/112024/ for in depth info.


how to remove index.php? - El Forum - 05-21-2012

[eluser]Mohammed Zayan[/eluser]
Check This http://ellislab.com/forums/viewthread/214907/


how to remove index.php? - El Forum - 06-13-2012

[eluser]Hamed[/eluser]
I am using Apache on windows
After I use your instruction I get

Not Found
The requested URL /fa was not found on this server.

Can anyone help me ?


how to remove index.php? - El Forum - 06-15-2012

[eluser]Hamed[/eluser]
Anyone can help me?


how to remove index.php? - El Forum - 06-15-2012

[eluser]bauc[/eluser]
Is your site hosted in a subdirectory? You either need to edit the .htaccess line

From:
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

To
RewriteRule ^(.*)$ /{thedirectorywhereindex.phpis/}index.php/$1 [L,QSA]

Just change the directory {} part. The other solution is to edit your hosts file and edit the Apache virtual host file.


how to remove index.php? - El Forum - 06-15-2012

[eluser]Hamed[/eluser]
I am using Apache on windows.
I will test your solution.



how to remove index.php? - El Forum - 06-15-2012

[eluser]InsiteFX[/eluser]
All you need to do for Windows 7 is this

1) open c:\Windows\System32\drivers\hosts with notepad
2) add 127.0.0.1 localhost

That's it.

3) Oh, make sure you save it.

On Windows when you first open the site it will show index.php all other calls it will be missing but does not show up on a live site.



how to remove index.php? - El Forum - 06-16-2012

[eluser]Hamed[/eluser]
Then, There is no problem with Windows server 2003? I have windows server 2003 with ZPanel.
I cann't find hosts.