SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hide .inc files using .htaccess?

    Hi,

    How do you hide and prevent viewing of .inc files using htaccess?

    Whats the code to allow other extensions..like .ph3 to run as a php script?

    Thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  2. #2
    SitePoint Addict zoordaan's Avatar
    Join Date
    Feb 2001
    Location
    NYC/Texas
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure about the .inc files but to make .ph3 (do you mean .php3?) executable add ' AddType application/x-httpd-php .ph3' to your .htaccess file. If you want more than one file type just add it also like so ' AddType application/x-httpd-php .ph3 .phtml'

    Remember to remove the ' ' .

  3. #3
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thank you zoordaan

    that was my alternative. if i cna't hide nad preview file access to .inc, i would make it execute like a php file so people can't view the contents.

    thanks
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  4. #4
    SitePoint Zealot Overgrow's Avatar
    Join Date
    Jan 2001
    Location
    Your basement
    Posts
    192
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The simplest way is to rename your .inc to .inc.php then it can't be viewed!

  5. #5
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i got it guys anyway. thanks

    her'es it. it refuses access, so any trying to access it will encounter an error 403.


    Code:
    <Files ~ ".inc"> 
    Order allow,deny 
    Deny from all 
    </Files>
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  6. #6
    Anyone seen my cypher? OneChance's Avatar
    Join Date
    Apr 2001
    Location
    Seattle
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sure this question has been answered several times before. I remember seeing it at least once. Maybe a search would have done you better.

  7. #7
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    really? i only know there were alot of questions directed at .htaccess. majority was finding how to set directoryindex...etc.
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein

  8. #8
    Anyone seen my cypher? OneChance's Avatar
    Join Date
    Apr 2001
    Location
    Seattle
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  9. #9
    The Hiding One lynlimz's Avatar
    Join Date
    Jul 2000
    Location
    Singapore
    Posts
    2,103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you OneChance =)
    "Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world."
    -- Albert Einstein


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •