1

.htaccess works fine in my xampp server but when I uploaded it to the web server, it gives me this error"404 Page Not Found The page you requested was not found."

here are my configs.

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

and my .htaccess is

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]

I place my codeigniter in a subfolder /sibulanAdmin http://sibulanlgu.spillworks.net/sibulanAdmin/

This cost me a lot of time searching in the web, but no solutions works for me. please help

2 Answers2

0

As your provided information, your .htaccess should be like this.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /sibulanAdmin/index.php/$0 [PT,L]

Make sure mod rewrite is enable on your server. If not yet, you should follow on this answer and this tutorial. Hope it will be work for you.

Edit

You can enable mod rewrite by typing in terminal like that :

a2enmod rewrite

And then, don't forget to set AllowOverride to all of document root in your apache configuration. In your apache2.conf, (/etc/apache2/apache2.conf in my case)

<Directory /var/www/>
    AllowOverride All
</Directory>

Finally, just need to restart your server.

service apache2 restart
Community
  • 1
  • 1
Arkar Aung
  • 3,423
  • 1
  • 14
  • 25
  • I tried this code, but still not working. As I checked, mod_rewrite was not enabled. I also tried the two links you recommend. Still not working. – Chong Alburo Mar 14 '15 at 12:39
0

Try this htaccess below, it works for me I have xampp and works fine on live server

And Change

$config['uri_protocol'] = 'REQUEST_URI';

To

$config['uri_protocol'] = 'AUTO';

htaccess

Options +FollowSymLinks
Options -Indexes

<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
    Order deny,allow
    Deny from all
</FilesMatch>

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Mr. ED
  • 11,163
  • 10
  • 51
  • 114
  • May be start with fresh copy of codeigniter from http://www.codeigniter.com/download and / or then go to here http://www.insiderclub.org/downloads and you can download some htaccess files there. But once added htacces in main directory then go and make `$config['index_page'] = '';` like so – Mr. ED Mar 14 '15 at 12:55