Nosotro Alentamo free asked 5 years ago

Hi to all. I need to know how to enable CORS in Codeigniter. I have apache2 in my Linux box, if I put the template example of MDB into a subfolder of /var/www/html I can load the sample page with no issues. So apache2 is not the problem. If I use the template page in CodeIgniter in a different folder in /var/www/html the page loads but I get content not allowed by Cors policy. Any ideas? Thanks

Rafał Rogulski free answered 5 years ago

It should work.I describe how I did this. First, I create asset folder in a root directory, it should look like:

|-css - there put CSS file from MDB pack
|-font - there put fonts folders from MDB pack
|-js - there put js file from MDB pack
now I paste HTML to a template, in my case welcome_message.php (default file in new CodeIngniter pack), and I change the path. Sample: <link href="assets/css/mdb.css" rel="stylesheet">

Nosotro Alentamo free answered 5 years ago

Inside an assets folder in the root fo CI: --Application --System --Assets |_css |_js |_font

Rafał Rogulski free answered 5 years ago

Wher you put all files like .css,.js and fonts?

Nosotro Alentamo free answered 5 years ago

Hi, Thank you sorry for my delayed response. I basically have Elementary OS on my computer, I then installed LAMP Stack, later I downloaded Codeigniter. Once I have all setup, fresh installs for each, and CI opened showing its welcome page, I grabbed one of the free templates of MDB I put the HTML in CI view and loaded every CSS and JS necessary. The template loads with its style but the menu is not showing properly, the fonts are not being loaded and the error in the developer's section says something about CORS policy not allowing. I search online a lot, attempted many potential solutions but none worked. Such as modifying the .htaccess and htdocs.conf. So I ended up giving up on MDB. But if you can try a similar setup as mine, you will the error that I am talking about. Thanks A lot.. best regards..

Rafał Rogulski free answered 5 years ago

Hello, Can you describe me what you want to do? Regards

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.


Specification of the issue

  • User: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No