CodeIgniter Forums

Full Version: Nothing in the tutorial of codeingniter for htaccess works for me. can anyone give me a hand?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]spidy[/eluser]
I am getting frustrated trying to figure out the issue of htaccess. I tried all the tutorial from codeingiter nothing is work.
I am running apache2 in ubuntu 10.04. the rewrite mode is already enabled.

Here is the url that I test.
———works————-
http://192.168.1.1/
http://192.168.1.1/index.php
http://192.168.1.1/index.php/blog
http://192.168.1.1/index.php/blog/comment

———Fail to work———-
http://192.168.1.1/blog
http://192.168.1.1/blog/comment

error that I get is error 404 page not found
the default error 404 from browser not from codeigniter

Greatly appreciate your help.

El Forum

[eluser]falkencreative[/eluser]
And just to confirm, you have a controller (within the application/controllers folder) named "blog" with a functions named "index" and "comment"?

What is currently in your .htaccess file?

El Forum

[eluser]2think[/eluser]
Spidy,

1. Try setting up a hostname in your /etc/hosts file in Ubuntu. I don't know your level of experience with Ubuntu/Linux so if you don't know, open it with the following in terminal: sudo nano /etc/hosts. Then restart your networking with the following in terminal: sudo /etc/init.d/networking restart (think that was it on Ubuntu to restart networking).

2. Make sure you've setup the appropriate hostname in your config.php file. It's one of the first things you're told to do in the Installation Instructions: http://ellislab.com/codeigniter/user-gui...index.html


Falkencreative, he already listed what controllers worked just needed to remove index.php.

El Forum

[eluser]falkencreative[/eluser]
[quote author="2think" date="1275801263"]Falkencreative, he already listed what controllers worked just needed to remove index.php.[/quote]
Sorry, read the original post a bit too fast. Ignore my comments then.

El Forum

[eluser]2think[/eluser]
Falkencreative,

No problems, I think we all have our moments where we speed read through a post.

If he hadn't listed those URLs, it probably would have been one of the first things to check.

El Forum

[eluser]spidy[/eluser]
Thanks for quick replying guys.

basically I did follow what ever is in this web
http://codeigniter.com/wiki/mod_rewrite/
http://ellislab.com/forums/viewthread/60406/
http://www.maheshchari.com/codeigniter-htaccess/

At the moment this is what I have in my htaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

El Forum

[eluser]daelsepara[/eluser]
Can you try this one and see if it works for you?

Code:
RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|user_guide)
RewriteRule ^(.*)$ index.php/$1 [L]