Welcome Guest, Not a member yet? Register   Sign In
Cannot reach dir in root dir.


I am currently developing a website in Codeigniter 2.1.3, and to this point it's going really well.
However, today a really weird problem occured.

When I started this project, I put three directories in the root of the project. They're called 'js', 'css', and 'img'. And I can reach them by typing mydomain.com/js, mydomain.com/css, and mydomain.com/img.

Today, I needed a folder called 'cache' aswell. So I created the folder in the root, and tried to reach it. And here's my weird issue: When I typed mydomain.com/cache, I was redirected to mydomain.com/cache/?/cache, and this gave me the following response:

Quote:404 Page Not Found

The page you requested was not found.

So I thought to myself, maybe the problem is within the name 'cache'. So I tried to create a new folder called 'trololo', just for testing purpose. Again I was redirected to mydomain.com/trololo/?/trololo.

I also tried to remove all my self-made routes in application/config/routes.php. This had no effect.

Has anyone had a similar problem? Any clue what it is about?

I can also say, I'm currently trying to get Carabiner to work with my project, so in production environment, Carabiner will merge and minimize my css and javascript files.

Thanks in advance!

Best regards,

Are you using an htaccess? My guess is your are passing everything to index.php.

Try using this one:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

which will pass requests to index.php, only if it ISN'T a REAL file/directory.

Thanks a million, CroNiX! It works perfectly fine now! Smile
However, I really need to learn to write proper htaccess-files. Do you know any good tutorial website where I can learn?

// Johan

Theme © iAndrew 2016 - Forum software by © MyBB