开发者

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 CodeIg开发者_StackOverflow社区niter 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜