Welcome Guest, Not a member yet? Register   Sign In
Still with index.php problem
#1

[eluser]onecode[/eluser]
Before i'm talking about my problem here, i'm sorry for this topic, i know there are many thread about this topic --> "how to delete index.php from CI url" ....But i have been working with all tips, including with my htaccess code:

Code:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

and i still have a problem with index.php, and this means all request cannot work if without index.php. I have a controller class "register" and im also add some url suffix with ".html" so all request url will be "http://localhost/ci/index.php/register.html" <-- a strange url huh? :down: ..This url is working well, but if i try to delete index.php, then i've got some error message.

I'm also done with config.php, with means i have change line 26 for $config['index_page'] with an empty string. But it still cannot work.

Please try help me, i have read many thread in this forum but nothing find some helpfull information for me Sick
#2

[eluser]Dog Cow[/eluser]
[quote author="onecode" date="1233094244"] but if i try to delete index.php, then i've got some error message.[/quote]
You try to delete the actual file, index.php? That will surely cause errors!
#3

[eluser]Rey Philip Regis[/eluser]
First make sure that your apache mod_rewrite is enabled.

Second make .htaccess file like this
Quote:RewriteEngine on
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Third go to the config folder and edit the config.php
from $config['index_page'] = "index.php"; to $config['index_page'] = "";

Then you're good to go.

Hope that helps..
#4

[eluser]tpiscotti[/eluser]
Hi Rey,

I've been having the exact same problem -- on both my Windows AND Mac environment actually. Cannot get this to work at all on either and I too have been following many suggested solutions from the forums as well as from suggested setup in the User Guide.

I followed the 3 main steps exactly as you posted them for the .htaccess file, my config.php file and also verified that mod_rewrite is most definitely enabled (I usually enable this right away whenever I set up Apache on a machine). Everything works fine if I upload these files to my remote host so it's definitely a local environment settings issue.

Here is a profile of my Windows development environment if it helps (I'm away from my Mac at the moment):
- Windows XP Pro
- Apache 2.2.11
- mod_rewrite IS ENABLED (I always have this enabled). The preceding hash mark is removed from the appropriate LoadModule line within httpd.conf. If there is another setting I should be aware of, please let me know.
- All statements of AllowOverride within httpd.conf are set to All
- PHP 5
- MySQL 5.1
- CodeIgniter 1.7.0, index.php and the /system folder of core files are copied to a test site area on my computer at: C:\Apache\htdocs\blogtest

Everything works fine if I include index.php in the URL (as it should) but I would like to removed this and to force a .html suffix.

If you (or anyone else reading this) need additional info for me, please feel free to let me know.

Thank you very much for any assistance you can provide!!

Best,
Tony
#5

[eluser]Colin Williams[/eluser]
Rey, your first RewriteCond is superfluous. You can do without it.

And onecode, try adding the FollowSymLinks option

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

[eluser]Colin Williams[/eluser]
Quote:This url is working well, but if i try to delete index.php, then i’ve got some error message.

What error message do you get? That might help us diagnose it for you.
#7

[eluser]tpiscotti[/eluser]
Colin, just revised my .htaccess file to try your version. I'm still getting the 404 error:

Not Found
The requested URL /blogtest/blog/test was not found on this server.

Just to clarify though...I thought .htaccess was for overriding settings in httpd.conf that users on a shared host would otherwise not have direct access to. Assuming that's correct (and please correct me if I'm wrong), I should really even need a .htaccess file if my issue is happening on my localhost where I do have direct access to httpd.conf to enable mod_rewrite. Is that correct? (Just wanted to make sure).

Thanks!
tony
#8

[eluser]Colin Williams[/eluser]
You have to load mod_rewrite from httpd.conf, yes. Or at least, that's where you should do it. And you could do the mod_rewrite rules in any config file, yes. But you would need to use a <Directory> tag, I believe. The fact that you are getting a 404 from your server means the rewrite rules are not taking effect. Have you tried to purposely generate a 500 error with your .htaccess file, just to ensure the .htaccess file is effective?
#9

[eluser]tpiscotti[/eluser]
I have not tried that yet. Can you let me know what I should add to the .htaccess file to generate the 500 error?

I currently have the .htaccess file located at the same level as the index.php bootstrap file. Is that the correct location, or do I just have it in the wrong location to begin with?

Thanks, Colin!
Tony
#10

[eluser]Ch!ps[/eluser]
this should b more than enough for you http://ellislab.com/forums/viewthread/95247/




Theme © iAndrew 2016 - Forum software by © MyBB