Monday 25 May 2015

Block directory browsing in PHP


It is very important part for any web application. At one side, when we are taking care a lot to prevent our code to be copied, why we forget to implement Directory Browsing. At least you can save your client side scripts and images. By implementing this mechanism your application will deny to display js, jquery, stylesheet, image directories or even any directory of application.

Best thing about this mechanism is it’s implementation, it is very easy. Just one line of code, need to be changed or written. It is worth to write.

As much as I know, there are 2 ways you can implement this.


  1.     Update apache server configuration file i.e. httpd.conf
  2.     Update application’s .htaccess file

Update httpd.conf file:
Replace:
Options Indexes  FollowSymLinks
To:
Options FollowSymLinks
Update .htaccess file:
Add below line:
Options -Indexes

That’s all, You are done :)

As much as I know, there are 2 ways you can implement this.
  1. Update apache server configuration file i.e. httpd.conf
  2. Update application’s .htaccess file

Update httpd.conf file:

Replace:
1
Options Indexes  FollowSymLinks
To:
1
Options FollowSymLinks

Update .htaccess file:

Add below line:
1
Options -Indexes
That’s all, You are done :)
- See more at: http://blog.trimantra.com/block-directory-browsing-in-php/#sthash.NSIR9Cra.dpuf

Friday 23 December 2011

How to setup multiple site using wordpress 3.0

This new feature is being called Network or Multi-site option.
By default this feature is disabled.
If you want to use this option in your WordPress, then you would have to enable it.

To enable this feature, simply open your wp-config.php file located in your WordPress root folder. Then add the following line anywhere in the file:

define(‘WP_ALLOW_MULTISITE’, true);

Now follow below steps to create multiple blog site,
In the wordpress admin section go to Tools > Network. Choose subdomains amongst sub-domains and sub-directories. Follow the instructions on the screen to finish the network setup.
Once you finish the network setup you’ll have the Super Admin panel activated on the admin screen.
Go to Sites > Add New site (for the secondary domain). For now we’ll have to set it up as a subdomain and we’ll later map it to the main domain. Let’s create it as primarydomain/secondary/
Browse to this site and verify that everything is fine.

Monday 19 December 2011

Set php.ini file according to project

To Set php.ini file according to your project follow the steps

1. Create .htaccess file in your project root folder
2. Put below line of code in that
3. Save File
4. Refresh apache server

Line of code is

php_flag file_uploads On
php_value memory_limit 8M
php_value post_max_size 8M
php_value upload_max_filesize 4M

Change size as your requirement...


Thanks