r3m1ck official site

The ordinary boy who like to programming java,programming python,developer a desktop application,mobile application,web designer

All About .htaccess

Posted by admin On March - 15 - 2011 Views: 10,623

. Htaccess file is a simple ASCII text file located in your www directory or in a subdirectory folder www. We can create or edit this file in Text Editor (Notepad) and then upload it to the directory we want to change its setting. Make sure that the file isuploaded in ASCII not BINARY format, and make sure the file permissions for the filewas set to 644 (rw-r-r-). This allows the server to access the files but prevent users toaccess files from their browser.

  1. Prevent Access To. htaccess
    Add the following lines to increase the security of. htaccess file so that if there is anyattempt to access the file will display an error message 403. Of course do not forget togive file permissions to 644.
  2. View Code HTACCESS
    <Files .htaccess>
     order allow,deny
     deny from all
    </Files>
  3. Prevent Access to Specific Files
    To restrict access to certain files we can use the following command. Change name rahasia.txt be according to our needs. Later, the file will be hidden and if there is attempt to access the file will be an error 403.
  4. View Code HTACCESS
    <files rahasia.txt>
     order allow,deny
     deny from all
    </files>
  5. Prevent Access To Many Files
    We can replace some extensions below in accordance with what we need.
  6. View Code HTACCESS
    <FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh)$">
     Order Allow,Deny
     Deny from all
    </FilesMatch>
  7. Prevent Users To Browsing On Every Directory Our Server
  8. View Code HTACCESS
    Options All -Indexes
  9. Allow Users To Browsing
    If we allow users to do browsing on “directory that we have set” simply add the command as below. (Simply put. htaccess file in the folder you want)
  10. View Code HTACCESS
    Options All +Indexes
  11. Prevent Users Browsing Without Doing 403 Error Messages
  12. View Code HTACCESS
    IndexIgnore *
  13. Prevent Users To Restrict Browsing With Extension Files.
  14. View Code HTACCESS
    IndexIgnore *.wmv *.mp4 *.avi *.3gp
  15. Changing the Index Files
    By default when we create several files and one of them there are index files, the file tersebutlah to be run first. By using. htaccess we can turn it into a file name we want.
  16. View Code HTACCESS
    DirectoryIndex home.php
  17. PHP Extension disguise
    This is very useful to add security in PHP applications that we make. We can replace the php extension in our application with the extensions that have been registered by us, probably “geje”, “crot”, etc.. Now with the following code, the file will still be read as a PHP file. A note, usually I find the httpd.conf file and add extensionnya there, but this is the excess. htaccess. We do not need to change the original setting on the Apache.
  18. View Code HTACCESS
    AddType application/x-httpd-php .r3m1ck

    Sponsored links


  19. Restrict access to the LAN (Local Area Network)
  20. View Code HTACCESS
    <Limit GET POST PUT>
     order deny,allow
     deny from all
     allow from 192.168.21.22
    </Limit>
  21. Automatic Giving To Each File CHMOD
  22. View Code HTACCESS
    chmod .htpasswd files 640
    chmod .htaccess files 644
    chmod php files 600
  23. Protect From Attacks DOS (Denial Of Service) With Limiting Upload File
    This is one simple method that we can use to prevent DOS attacks. Here we limit the upload size of 10240000 bytes equal to 10 mb.
  24. View Code HTACCESS
    LimitRequestBody 10240000
  25. Mengamankan Direktori Dari Pengeksekusian Script Atau File
  26. View Code HTACCESS
    AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
    Options -ExecCGI

Tags: , , ,

Facebook Comments

One Response to “All About .htaccess”

  1. Xr0b0t says:

    muanteb mas remik hahha :P

Leave a Reply

 

Fighting The Gravity – blink182

Fighting The Gravity This makes no sense This makes no sense This makes no sense This makes no (no, no, no, no) This makes no sense This makes no sense This makes no sense This makes no (no, no, no, no) This makes no sense Read the Rest…

My Twenty one on Twenty one June 2011

Today, June 21th 2011 , I was 21 years old, new ages … new hopes .. many birthday greeting that I received from my friends. I also got surprised from my dear, after my maghrib prayer I was surprised by the arrival of my girlfriend with her friend who brought a cake and singing happy birthday sung by my friends. I am very happy, thanks for all my friends,, Read the Rest…

How to Upgrade FreeBSD 8.0-RELEASE to 8.2-RELEASE

The second Release Candidate for the FreeBSD 8.2 release cycle is now available. Initial testing of the 7.4-RC2 install images turned up an issue with the pre-built packages that will take a few more days to address. For this build only the amd64, i386, pc98, Read the Rest…

Change plus into minus on search permalink

How to change the plus into minus on search permalin? usually we found our search permalink was site.com/search/what+the+hell and here its the way to change into site.com/search/what-the-hell . 1. Login to your cpanel, site.com:2082 2. Open the file manager and goto themes directory, wp-content/themes/your-themes 3. Read the Rest…

SBY: UU Keistimewaan DIY Harus Atur Suksesi Sultan

Jakarta – Presiden Susilo Bambang Yudhoyono berharap UU Keistimewaan Daerah Istimewa Yogyakarta tidak bersifat situasional. UU ini juga harus mengatur suksesi kepemimpinan di kemudian hari. “Pemerintah berpendapat bahwa UU tentang Keistimewaan DIY juga mesti mencakup kepemimpinan, baik yang sedang memimpin sekarang ini, Sultan Hamengku Buwono Read the Rest…

Fans Box

  • Donate Me :)

  • Web Statistics