CodeIgniter Forums
Default Controller Route - 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: Default Controller Route (/showthread.php?tid=5297)



Default Controller Route - El Forum - 01-16-2008

[eluser]Pascal Kriete[/eluser]
I decided to seperate my system folder from my apps today. So I moved a bunch of stuff around, set the $system_folder and $application_folder variables in my index.php.

Then I tossed in my .htaccess file:
Quote:RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

And set
Code:
$config['index_page'] = "";

Now when I go to http://localhost/testpage/index.php it opens my default controller and everything works fine. The urls are rewritten properly, the links work - great.

But if I go to http://localhost/testpage/ it throws a The URI you submitted has disallowed characters. error.

I tried turning mod_rewrite off again, tried setting DirectoryIndex - nothing helps. This worked fine before I seperated my folders.

Any ideas?


Default Controller Route - El Forum - 01-17-2008

[eluser]Pascal Kriete[/eluser]
Still having this problem :long:.


Default Controller Route - El Forum - 01-17-2008

[eluser]tonanbarbarian[/eluser]
I find that if I have a site in a subfolder of the website and I want to remove the index.php I have to modify the .htaccess

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /testpage/index.php/$1 [L]

You might also be able to do something with the RewriteBase I am not sure
so the following might also work, i think I tried it and it didnt but not sure
Code:
RewriteEngine on
Rewrite Base /testpage/
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]