Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Showing posts with label .htaccess. Show all posts
Showing posts with label .htaccess. Show all posts

Tuesday, October 9, 2012

Organizing short folder structure Using mod_rewrite

Organizing short folder structure Using mod_rewrite
Sometimes long folder names become annoying to type and can cause your page to result in huge loading time. Thank GOD !!! .htaccess file is there with a solution for this problem. It also leads to Search engine friendly URLS and image names (for image searches) 




Thursday, September 20, 2012

Allow or Block IPs Address - .htaccess Security


Hypertext Access, commonly shortened to htaccess, is a configuration file which controls the directory it is placed in and all the subdirectories underneath it. It's an incredibly useful feature which allows webmasters to control how many aspects of their website works. You can 301 redirect pages, change the extensions of pages, rewrite urls for better keyword ranking presence, password protect directories, Error 404 Document redirect and much much more. .htaccess provide security to allowing and blocking access to a web server from a IP address. Reasons for doing this include: 

Password Protection on Directory Using .htaccess


Password Protection on Directory Using .htaccess
If your files are not protected then one must think over the protection of the file. Protection can be provided in various ways like PHP login page, but it will not protect your documents, images and other media. We can protect the files using .htaccess protection. The system requires two files -- the .htaccess file and .htpasswd file. 

Wednesday, September 19, 2012

Prevent Directory Listings using .htaccess


Prevent Directory Listings using .htaccess
In current scenario, preventing a directory listing for your website is must. To prevent the directory listing, you just need to write one simple line in your .htaccess file and your directory structure is unvisible.



  Options -Indexes


Make it a habit to prevent your directory listing.

Setting up Directory Home page (Index page) Using .htaccess

Setting up Directory Home page (Index page) Using .htaccess
Apache server is usually set to index.php or index.html. Good practice to set your DirectoryIndex setting in your .htaccessfile. If we want to set any other file except index.php or index.html then we can achieve this using .htaccess


   DirectoryIndex index.php index.html index1.php


Block Unwanted Referrers - .htaccess

If we want to block some unwanted referrers then we can achieve it with small bit of .htaccess code and mod_rewrite.

   RewriteEngine on
   RewriteCond %{HTTP_REFERER} digg.com [NC]
   RewriteRule .* - [F]

Detect Android with PHP, Javascript & .htaccess

Android is a Linux-based operating system, designed primarily for touchscreen mobile devices such as smartphones and tablet computers. Andriod is initially developed by Android, Inc. 
While working in web technology environment, many times we came accross the situation where we need to detect that if it is Android is not. This detection can be done in multiple ways like: 
1. Using PHP 
2. Using Javascript 
3. Using .htaccess 
It totally depends on the interest of developer, which mechnaism he/she choose to detect android.