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:

[sourcecode language=”plain”]Options Indexes FollowSymLinks[/sourcecode]

To:

[sourcecode language=”plain”]Options FollowSymLinks[/sourcecode]

Update .htaccess file:

Add below line:

[sourcecode language=”plain”]Options -Indexes[/sourcecode]

That’s all, You are done :)

Transfer Blog from google to wordpress

Ohh, Welcome to my blog. Are you looking for the stuff which helps you to transfer your Google Blogspot posts to your own WP Blog Site? You are on right page.
I have recently completed this for our company blog site. Here, I am sharing my experience with you.
I have referred lots of stuff over internet. Eventually find one very good blog and done up with my task.

Follow below steps to import blog and to set redirection code:

A. Import Blog from Google

  1. Get one suitable domain name for your blog. If you have already domain name for your business, you can setup sub domain. E.g.
    Company Domain – http://www.trimantra.com
    Blog Domain – http://blog.trimantra.com
  2. Setup wordpress for this domain.
    To download – https://wordpress.org/download/
    To install – http://codex.wordpress.org/Installing_WordPress
  3. It’s time to import your blog post from Google Blogspot
    • Go to “Tools” -> “Import”
    • Click on “Blogger”
    • Click on “Install Now”, you will get below screen
      blogger-importer
    • Activate Plugin & Run Importer
    • Now you will be asked for authorization of blogger gmail account, login into gmail
    • Allow Access
      AllowAccess
    • Click on Import
    • Import
    • Let importer complete import. If you can’t see progress. Click again on “importing…” & “Continue..”.
      1. You will get “Set Authors” in place of “Import” button when you get done with import. Click on that button.
      2. Choose author you want to set for all blog post from available users. Admin user will be there selected by default.
      3. Click “Save Changes” Button and now you have done importing
        Set Authors
    • Once you done with this start setup of “301 Redirection”.

B. Setup 301 Redirection

Now, it is time to setup 301-redirection for new blog. 301 redirection which means a lot for any website transfer. You can read about 301-redirection here https://support.google.com/webmasters/answer/93633?hl=en

Generate Redirection Code,

  1. Install plugin Blogger To WordPress, For help on how to install plugins to your WordPress blog, check out our guide on How to manage plugins in WordPress.
  2. Installation and activation of plugin will create menu “Blogger to wordpress redirection”, Click on it. You can see menu in below screenshot.
    Untitled
  3. Click on “Set Configuration”
  4. Click on “Get Code”
  5. You will get “Generated Code”, copy it
    getcode

Copy Code to Blogger.com Template,

  1. Go to your blogger dashboard
  2. Click on template and Edit HTML
    Edit HTML
  3. Paste code in place of template code and save template
    PasteCode&SaveTemplate

C. Verify Redirection Code Setup

  1. Go back to WP “Get Code” screen and click on “Verify Configuration” button to verify if redirection Is working or not.
    Verify

You are done. Any of your blogger link redirect user to your wordpress blog.
Have a happy blogging.

Blog Transfer Reference:
Article: https://rtcamp.com/blogger-to-wordpress/tutorials/blogger-to-wordpress-redirection-plugin/
Plugin: http://wordpress.org/plugins/blogger-to-wordpress-redirection/

How to setup multiple site in wordpress

This new feature is being called Network or Multi-site option.

In WordPress By default this feature is disabled.
If you want to use this option in your WordPress, you need 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);
Refer to the attached picture.

 

Now to create multiple blog site follow below mentioned steps:

In the wordpress admin section:

  • Go to Tools > Network Setup. You can see screen as the attached image.

2

  • Press Install to configure network setup and follow the instructions on the screen to finish the network setup.

3

  • Once you finish the network setup you’ll have the Super Admin panel(Network Admin) activated on the admin screen.
  • You can find “Network admin” at top right, as you can see in the screenshot.
  • Clicking on it, You get Network Admin Dashboard

5

  • Now to start multi site setupGo to Sites > Add New site (for the secondary domain).
  • 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.

 

By, Sonal L Khunt