Welcome Guest, Not a member yet? Register   Sign In
xampp and .htaccess
#1

[eluser]trevor2[/eluser]
I'm having some issues removing the index.php from the url
The page I want to open and gives an error is: http://localhost/codeigniter/submit
If I type this page it works as normal: http://localhost/codeigniter/index.php/submit
Does xampp have it's own .htaccess?
How do I fix this?

C:\xampp\htdocs\codeigniter\system\application\config
$config['base_url'] = "http://localhost/codeigniter/";

.htaccess location
C:\xampp\htdocs\codeigniter\.htaccess

.htaccess
Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ codeigniter/index.php/?$1 [L,QSA]

Here is my httpd.conf file:
C:\xampp\apache\conf\httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so

The error page
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
#2

[eluser]Colin Williams[/eluser]
You're most likely entering an infinite loop with your rewrite rules. It can be tricky to pinpoint, but I would just try tweaking things.

For starters, your first RewriteCond is superfluous, since the next two conditions will handle all cases of files or directories existing.

And if index.php and .htaccess are both in the codeigniter folder, then you just need

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

What's probably happening is your rules are trying to direct the request to /codeigniter/codeigniter/index.php, which doesn't exist, which matches the %{REQUEST_FILENAME} !-f condtion, which tries to then request /codeigniter/codeigniter/index.php ... you can see the infinite loop going on.
#3

[eluser]trevor2[/eluser]
This is my error after taking out everything but the line you mentioned.

[Sat Feb 14 15:48:47 2009] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/codeigniter/submit, referer: http://localhost/codeigniter/index.php/submit
#4

[eluser]Colin Williams[/eluser]
Full thing, should be

Options +FollowSymLinks -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
#5

[eluser]trevor2[/eluser]
Beat me to to it.

I took your comment a bit too literal. :red:

This is my .htaccess now:

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]


EDIT: It works, thanks.
Another edit. That .htaccess I had there got rid of the stylesheet somehow.
Replaced it with yours and now everything is good to go.




Theme © iAndrew 2016 - Forum software by © MyBB