2

I have a Codeigniter install with a directory 'sandbox' at root. In sandbox i have document 'poster.html'. If i change this document's extension to .php, I get a CI 404 error. If i leave it as .html it works!

Edit: I just confirmed that .php extension does not work from any of the excluded directories like: css/ or scripts/ . Here is what the .htaccess file at the root directory looks like:

RewriteEngine on
RewriteCond $1 !^(index\.php|sandbox|css|scripts|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Current root directory structure:

application/
system/
css/
sandbox/
scripts/
.htaccess
index.php
6
  • where's the rule that produces the $1? Commented Sep 16, 2013 at 15:12
  • Check short / long tags in php.ini. Try changing your tags in the PHP file from <? to <?php. Commented Sep 16, 2013 at 15:14
  • Yes, the 404 is CI generated. Commented Sep 16, 2013 at 15:15
  • please post your directory structure, is the CI setup in root? / and then from root you have a folder called /sandbox ? If you can access a css/scripts file you should access a file in sandbox Commented Sep 16, 2013 at 15:16
  • Hi will be posting dir structure. Commented Sep 16, 2013 at 15:19

1 Answer 1

2

I believe your issue is either you have a typo somewhere, or you have a ROUTE conflict. I just recreated this with a new 2.1.4 CI install and created a sandbox folder with a php file in it.

I can confirm it is working 100%. Double check your spelling. You shouldn't be getting a CI 404 page for the /sandbox/ folder based on your .htaccess

As an alternate debug approach, turn up your ci logging and check the /application/logs for detail on what is it throwing a 404 on.

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

Comments

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.