I cant include js files |
Hello, first time using CI and seems awesome!
Im trying to include a js file and doesnt seem to work. Im getting 404 error not found. View File: PHP Code: <script type="text/javascript" src="<?php echo base_url();?>js/ajaxGetRegions.js" ></script> My js path: var/www/applications/js/ajaxGetRegions.js .htaccess PHP Code: RewriteEngine On Seems that the problem is the .htaccess I used to remove the index.php, altough i try to exclude the js folder from that. mod_rewrite is enabled. Any ideas what could be the issue ? (06-09-2016, 12:54 AM)isengart Wrote: Hello, first time using CI and seems awesome! Resource files (images, javascripts, stylesheets...) should be placed in a public folder, usually same folder with index.php
Remove this line in your .htaccess file you do not need it and it will cause problems!
Code: RewriteCond $1 !^(index\.php|images|js|robots\.txt) Also change to this: Code: RewriteRule ^(.*)$ index.php/$1 [QSA,L] What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
Server could be case sensitive also, try changing the name to all lower case.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |