+ Reply to Thread
Results 1 to 9 of 9

Thread: .htaccess

  1. #1
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    .htaccess

    I have a directory call it /files in this directory i have files that are collected by php scripts randomly placed on the site. Is it possible to block visitors form viewing this directory by typing in site.com/files/filename.php but still be able to use filename.php as an include on my pages.

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: .htaccess

    I think you don't even need .htaccess
    Just change the permissions to 700?
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: .htaccess

    How would i go about doing that. I have never worked with changing permissions and they are not the easiest thing to search on the net.

  4. #4
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: .htaccess

    Quote Originally Posted by Scoochi2 View Post
    I think you don't even need .htaccess
    Just change the permissions to 700?
    .htaccess:

    Code:
    <Files *>
    order allow, deny
    deny from all
    </Files>
    Include and Require by php will still work though; apparently PHP bypasses the .htaccess requirement since apache isn't actually serving the page to the user, it's being used by another php document.


    No idea how to change permissions though honestly, I've used this in the past but it's been a while - i -might- have the Files * line wrong, back stuff up before trying it!!!


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  5. #5
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: .htaccess

    ^ Looks right to me Livewire.

    To change permissions with X10's File Manger, select the file[s] and press the 'Change Permissions' icon/text.
    Then play around with the checkboxes until it says 700 at the bottom

    Both methods should work, though.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  6. #6
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: .htaccess

    It works for the php includes but now i am wondering if there is a simaller way to do the same for a folder with js includes. I have a js file that holds promo numbers and i want to hide them from most people atleast
    Last edited by driveflexfuel; 02-17-2009 at 06:55 PM.

  7. #7
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: .htaccess

    Quote Originally Posted by driveflexfuel View Post
    It works for the php includes but now i am wondering if there is a simaller way to do the same for a folder with js includes. I have a js file that holds promo numbers and i want to hide them from most people atleast
    PHP will run from the server side but JS is to run from the user side. This means that at one point, the js code needs to go to the user. Maybe you can find some answers at these posts:

    http://codingforums.com/showthread.php?t=9442

    http://www.webmasterworld.com/forum91/576.htm

  8. #8
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: .htaccess

    Thanks for the links they link to the site below.

    I found this site that works great. It will prevent almost anyone from reading your code.

    http://www.javascriptobfuscator.com/Default.aspx

  9. #9
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: .htaccess

    Quote Originally Posted by driveflexfuel View Post
    A free Javascript obfuscator! Thanks driveflexfuel !

+ Reply to Thread

Similar Threads

  1. Server Time-Zone To Local Time-Zone
    By rockee in forum Tutorials
    Replies: 4
    Last Post: 06-02-2008, 09:58 AM
  2. Se puede usar .htaccess????
    By rackfenix in forum Soporte
    Replies: 7
    Last Post: 10-02-2007, 07:03 PM
  3. default .htaccess
    By Fedlerner in forum Computers & Technology
    Replies: 9
    Last Post: 09-05-2007, 09:10 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