CodeIgniter Forums
Eliminating the 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: Eliminating the index.php (/showthread.php?tid=56623)

Pages: 1 2 3


Eliminating the index.php - El Forum - 01-09-2013

[eluser]Rowan Wilson[/eluser]
Append a trailing slash on your base_url:

Code:
$config['base_url'] = 'http://localhost/safememoirs/';

You can even try it without the base_url set.

If that doesn't work can try wrapping your htaccess inside IfModule:

Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

Otherwise, if you are certain mod_rewrite is working, check your apache logs? Looks like a server configuration rather than a CI configuration.


Eliminating the index.php - El Forum - 01-09-2013

[eluser]GabrieleMartino[/eluser]
[quote author="Rowan Wilson" date="1357729266"]Append a trailing slash on your base_url:

Code:
$config['base_url'] = 'http://localhost/safememoirs/';

You can even try it without the base_url set.

If that doesn't work can try wrapping your htaccess inside IfModule:

Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
</IfModule>

Otherwise, if you are certain mod_rewrite is working, check your apache logs? Looks like a server configuration rather than a CI configuration.[/quote]

If I check the error-log of apache (and not the normal but the dummy error-log) i get that it is looking for the index.php in the root directory and not in the one of the project the error
is
Code:
script '/srv/www/htdocs/index.php' not found or unable to stat, referer: http://localhost/safememoirs/index.php

I'll try to check the solution and If i get it I will post the exact version of the htaccess

Thanks


Eliminating the index.php - El Forum - 01-09-2013

[eluser]GabrieleMartino[/eluser]
Ok I get it work!! finally.

The .htaccess changed in

Code:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ safememoirs/index.php/$1 [QSA,L]
</IfModule>



Eliminating the index.php - El Forum - 01-09-2013

[eluser]Rowan Wilson[/eluser]
smashing :-)