+ Reply to Thread
Results 1 to 6 of 6

Thread: how to place files in other than www folder

  1. #1
    giganticgaint is offline x10Hosting Member giganticgaint is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    8

    how to place files in other than www folder

    Hi
    this is my site. http://forums.x10hosting.com/program...ay.exofire.net
    at present all my files are in public_html folder.
    i want to move some of them to other folders(css, javascript files)

    how can i do that and to which folders i can move.
    also after moving them to other folder how can i refer them.
    i tried to move them to other folders but i am unable to refer them in my script


    all in all what i want to do is, i would like to have a folder say, XYZ(this folder should not be in public_html. it should be out of public_html). and i want to place my .js files in this folder.After that in my index.html page i want to refer those .js files using relative path.

    any help pls.....
    Last edited by giganticgaint; 12-17-2008 at 01:38 AM.

  2. #2
    blobtech is offline x10Hosting Member blobtech is an unknown quantity at this point
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    16

    Re: how to place files in other than www folder

    If you have your html file (index.html) like this: /public_html/index.html and your css file: /public_html/css/index.css,
    you can refer to it using "css/index.css".

    You could also use a double-dot to go a directory back.
    Say, if you have your html file (index.html) like this: /public_html/test/index.html and your css in /public_html/css/testindex.css,
    you can refer to it using "../css/testindex.css".

    If you need to go multiple directories back, just treat them as a normal dir "../../../../css/testindex.css" (goes 4 dirs back, then one forward into "css").

    Please note that this still requires all files and directories to be inside public_html.
    If you want to serve from other directories (like /etc), you should look up mod_rewrite or aliases.

  3. #3
    giganticgaint is offline x10Hosting Member giganticgaint is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    8

    Re: how to place files in other than www folder

    Quote Originally Posted by blobtech View Post
    If you want to serve from other directories (like /etc), you should look up mod_rewrite or aliases.
    Thanks blobtech,
    but i want exactly what u said. but instead of etc,
    i have created a directory called personal and i want to refer files in that directory. at present i am trying to do this but it's not working;
    Code:
    <link rel="stylesheet" type="text/css" href="../personal/style.css" media="all">
    can u help me plss... i don't know anything about mod_rewrite.
    so can u show me some example regarding this...

    thanks

  4. #4
    vol7ron's Avatar
    vol7ron is offline x10 Lieutenant vol7ron is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    DC
    Posts
    434

    Re: how to place files in other than www folder

    If you don't know what you're doing, you should consult with an admin before trying to do something outside of public_html

    You could open a known security hole, especially if you redirect improperly.
    If you find my post useful please add to my reputation by clicking the +Rep button
    You may also use the Donate link to donate credits - this is appreciated too Thanks to those whom have donated so far!


  5. #5
    blobtech is offline x10Hosting Member blobtech is an unknown quantity at this point
    Join Date
    Nov 2008
    Location
    Netherlands
    Posts
    16

    Re: how to place files in other than www folder

    I should have added to my post:
    Folders on the user-root level are not for public files, any security hole in the website could potentially cause a lot more damage there.
    Its therefor highly discouraged and I don't know if its even allowed at x10hosting!

    Next to that, it would probably not solve your problem:
    Quote Originally Posted by giganticgaint at forums.x10hosting.com/review-my-site/92589-www-eway-exofire-net.html
    anyone can see my css,js files
    so i want to move them to a secure folder.
    Any additional files like scripts, stylesheets and images referred on a public page cannot be made inaccessible.
    Since all of them need to be downloaded by the webbrowser to display the page. (And thus all of them will end up on the viewers computer)
    People always will be able to read them. If its done by typing the url, or copying out of the cache, it doesn't matter.

    You can hinder possible copiers to some extent, but in the end they will always get the files.

  6. #6
    vol7ron's Avatar
    vol7ron is offline x10 Lieutenant vol7ron is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    DC
    Posts
    434
    I did not see that in the original post, he must have changed it.


    That is also correct, the css/js/html, anything that is used in the browser window is downloaded to the browser's machine. So each user downloads a copy of that file to their temporary internet directory.

    If there are files that are not used for the site that you do not want users to access, simply change the permissions on the file, or use .htaccess/.htpasswd to limit the users from accessing files (http://www.addedbytes.com/apache/pas...with-htaccess/)

    There is a way to dynamically create a folder, put css in there and then delete the files, that way users can not find the file by the browser, but it is pointless because the file will still be in their temporary internet folder.
    If you find my post useful please add to my reputation by clicking the +Rep button
    You may also use the Donate link to donate credits - this is appreciated too Thanks to those whom have donated so far!


+ Reply to Thread

Similar Threads

  1. HOW TO: upload Dreamweaver files using FTP
    By rmcghee in forum Tutorials
    Replies: 23
    Last Post: 03-08-2011, 01:19 PM
  2. Hide files in a jpg
    By fierce in forum Computers & Technology
    Replies: 0
    Last Post: 12-06-2008, 07:06 PM
  3. Cannot copy files using WebDisk
    By truffle in forum Free Hosting
    Replies: 2
    Last Post: 11-02-2008, 09:36 PM
  4. what folder do i use to upload files x10hosting
    By guraot in forum Free Hosting
    Replies: 3
    Last Post: 04-23-2008, 11:13 AM
  5. Cpanel:what a mess with domains and content
    By Namjies in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 12-12-2007, 05:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers