willbeeler
willbeeler

Reputation: 689

CodeIgniter htaccess Issue

I guess this is a general htaccess question instead of something specifically for CodeIgniter, however, I came across it doing work on my own CodeIgniter application.

I have a folder in the root directory called "admin" where the CSS, JS, and Images are. If I type in the following: http://example.com/admin/ it directs to that folder. I want my routes.php file to control all of that and send the user to the admin panel. Here's the route section:

$route['admin'] = 'admin'; (I have a controller that is called admin, and it's setup correctly)

How do I fix this issue? I'm assuming this is an htaccess file issue.

Upvotes: 0

Views: 241

Answers (1)

cbrandolino
cbrandolino

Reputation: 5883

You can fix it via .htaccess, but that will mean that the requests for the javascript and css will be routed as well: if, for instance, the browser tries to load http://baseurl.com/admin/style.css, the system will try to serve the output of the style.css() method in the admin controller, leading to an error.

How about renaming your resources folder to something more sensitive - for instance, resources?

That way you won't have to touch the .htaccess either.

Upvotes: 2

Related Questions