2

I know this has been asked many times before, but the previous solutions/answers aren't working.

I have viewed these:

I have used these solutions successfully in the past, but this install is giving me problems. I am thinking this might be more than an .htaccess issue.

Description

My folder setup is as follows: /home/~username~/public_html/~company~/index.php. My $config['index_page'] is set to "" and my server has mod_rewrite enabled. I am using CI version, 2.1.3

The .htaccess file is located in the same folder as the application folder.

Problem

I can't seem to remove the index.php from my URL without the application breaking. I have tried many, many .htaccess setups, including the one provided on the CI website.

I am at a loss. If it's not my .htaccess file, what could it be? If it is my .htaccess file, what am I doing wrong? My latest attempts are these:

RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php) [NC]    
RewriteRule ^(.*)$ /home/username/company/index.php/$1 [L] //absolute path
and
""
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ company/index.php/$1 [L]

Full apache error:

[Thu Jan 24 18:22:13 2013] [error] [client ip ] 
File does not exist: /home/username/public_html/company/home
5
  • 1
    1. You say you're "90% sure". Can you use apache_get_modules() or something to be 100% sure? 2. Your RewriteRule is missing public_html, is that intentional? Commented Jan 24, 2013 at 16:47
  • 1. I ran that function and it is indeed installed. 2. I tried with public_html and without, no difference. Commented Jan 24, 2013 at 16:49
  • Can you post the exact error message you get when you remove index.php from the URL? (It could be in either the apache error log OR the CI application log.) Commented Jan 24, 2013 at 16:58
  • I don't have access to the apache log and the CI application/log only has an empty index.html file. Commented Jan 24, 2013 at 17:09
  • It's probably to do with your host's apache setup, but it's going to be really difficult to debug without seeing the errors. Commented Jan 24, 2013 at 17:24

1 Answer 1

0

Set the variable empty as below.

$config['index_page'] = '';

try to replace following variable with these parameters ('AUTO', 'PATH_INFO', 'QUERY_STRING', 'REQUEST_URI', and 'ORIG_PATH_INFO') one by one

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

Sign up to request clarification or add additional context in comments.

4 Comments

with what .htaccess configuration?
the one in the same folder as application folder
what do you mean? I am trying to figure out what .htaccess file setup I should use.
the one you are currently using seems right for me, the solution i suggesting here for the this "I can't seem to remove the index.php from my URL without the application breaking"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.