Welcome Guest, Not a member yet? Register   Sign In
CI, Xampp, and mod_rewrite
#1

[eluser]stretchnate[/eluser]
Ok first I know there have been a few posts on this topic and I have tried the advice in them to no avail. I'm running Xampp on windows xp pro and using code igniter. One thing to note is my CI application is in a subdirectory. below are my config details.

config.php
$config['base_url'] = "http://localhost/n8/";
$config['index_page'] = "";

.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /n8/

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.

# all these paths will be ignored
RewriteCond %{REQUEST_URI} !^/index\.php.*
RewriteCond %{REQUEST_URI} !^/pma.*
RewriteCond %{REQUEST_URI} !^/manager.*
RewriteCond %{REQUEST_URI} !^/images.*
RewriteCond %{REQUEST_URI} !^/css.*
RewriteCond %{REQUEST_URI} !^/javascript.*

# rewrite url (if it doesn't match the paths listed above)
RewriteRule ^(.*)$ /n8/index.php/$1 [L]
</IfModule>


httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so

<Directory "C:/xampp/htdocs">
Options Indexes Includes FollowSymLinks MultiViews
AllowOverride AuthConfig FileInfo
Order allow,deny
Allow from all
</Directory>

the following three things have been modified in every order to either have or not have the "n8" in them but no combination works... I keep getting a 500 internal server error.

$config['base_url'] = "http://localhost/n8/";
RewriteBase /n8/
RewriteRule ^(.*)$ /n8/index.php/$1 [L]

I've also tried combinations with the RewriteRule having no leading / before the n8.

I've followed the instructions in the wiki (http://codeigniter.com/wiki/mod_rewrite/) and even used the .htaccess that is available there.

I've also tried the suggestions in each of the following posts.
http://ellislab.com/forums/viewthread/46715/
http://ellislab.com/forums/viewthread/100487/#507300

does anyone have any other suggestions?
#2

[eluser]Sarfaraz Momin[/eluser]
This works for me on XAMPP with CI installation. I have vhost configured for XAMPP and its works great.

Code:
Options +FollowSymLinks
RewriteEngine On

RewriteBase /

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

[eluser]stretchnate[/eluser]
thanks for the response, I tried your code and it didn't seem to make a difference. and by that I mean I still get the index.php in my url, on the plus side my page still loads Smile
#4

[eluser]Sarfaraz Momin[/eluser]
Ok. Just remove the index.php from the config file

Code:
$config['index_page'] = "";
#5

[eluser]stretchnate[/eluser]
already did.
#6

[eluser]TheFuzzy0ne[/eluser]
Try removing the ReWriteBase. It's not necessary unless you have an alias set up in your vhosts file.
#7

[eluser]stretchnate[/eluser]
still no joy
#8

[eluser]TheFuzzy0ne[/eluser]
Uhm... Am I hallucinating, or do you have:
Code:
$config[‘base_url’] = “http://localhost/n8/”;

written in your htaccess file?

EDIT: I'm hallucinating. I saw:

$config[‘base_url’] = “http://localhost/n8/”;
RewriteBase /n8/
RewriteRule ^(.*)$ /n8/index.php/$1 [L]

and thought, Huh??
#9

[eluser]Georgi Veznev[/eluser]
Have you tried to restart the Apache service? Sometimes the changes do not take effect after the first restart? (Do not use the XAMPP control panel)

Also double check:

Code:
$config['base_url']    = "http://localhost/n8/";
$config['index_page'] = "";
#10

[eluser]TheFuzzy0ne[/eluser]
Have you commented out the last line to be sure it's none of the rewrite conditions that is causing the error?




Theme © iAndrew 2016 - Forum software by © MyBB