Welcome Guest, Not a member yet? Register   Sign In
[newbie] location of scripts & images
#1

[eluser]phusiondesign[/eluser]
This is probably rudimentary but I am new to the VMC setup and am having problems accessing my files.

I got CodeIgniter up and working on my server and then I put an .htaccess file into place in order to remove 'index.php'.
Code:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond $1 !^(index\.php|images|robots\.txt)
  RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
  ErrorDocument 404 /index.php
</IfModule>
Then I realized that my call to files were not working, i.e. www.example.com/_scripts/java.js or www.example.com/_images/image.jpeg. Where do I need to put those files in order to use them successfully along with my .htaccess file. Also, I have not tried my CSS files yet, but I would assume they would give the same problem.

Thanks in advance.
#2

[eluser]Pascal Kriete[/eluser]
You can keep them where they are, but you have to add the folders to your htaccess file.
Code:
RewriteCond $1 !^(index\.php|_images|_scripts|robots\.txt)
#3

[eluser]mdavis1982[/eluser]
Either do as inparo says, or, what I do, is create a public folder and have sub-folders in there for images, css, scripts, etc.

Then, in your .htaccess, you only have to let the public folder through and if you need to add anything (like another scripts, directory, different image directory etc) then it will automatically be available.

Hope that helps?

Cheers...

Matt




Theme © iAndrew 2016 - Forum software by © MyBB