apache redirect one domain to another site

Sometimes we need the redirection rule for your website. When you want to divert your website traffic to another site.

That is very easy to writing or putting the one site to another site redirection rule through apache.

apache redirect one domain to another site

You need to put entry in your virtual host section or if you are having shared hosting then open your .htaccess file and put following entry in that file

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

You just change newdomain.com to your new website name.

apache redirect one domain to another site
apache redirect one domain to another site

How to use bloginfo in wordpress theme

For each wordpress theme developer the bloginfo() function is very useful. If you are not used the bloginfo function then use the bloginfo function. There is great help is provided wordpress api. In every wordpress theme we need to use the bloginfo method. bloginfo() function is useful. If you not used bloginfo function than use bloginfo function. Every theme we need to use bloginfo in wordpress theme.

How to use bloginfo in wordpress theme

How to use bloginfo in wordpress theme
How to use bloginfo in wordpress theme

Displays information about your blog, mostly gathered from the information you supply in your User Profile and General Options from the WordPress Administration panel.

Following parameter is passed in this method.


name = TestWpapi
description = Just another WordPress blog
admin_email = admin@example

url = http://example/home
wpurl = http://example/home/wp

stylesheet_directory = http://example/home/wp/wp-content/themes/child-theme
stylesheet_url = http://example/home/wp/wp-content/themes/child-theme/style.css
template_directory = http://example/home/wp/wp-content/themes/parent-theme
template_url = http://example/home/wp/wp-content/themes/parent-theme

atom_url = http://example/home/feed/atom
rss2_url = http://example/home/feed
rss_url = http://example/home/feed/rss
pingback_url = http://example/home/wp/xmlrpc.php
rdf_url = http://example/home/feed/rdf

comments_atom_url = http://example/home/comments/feed/atom
comments_rss2_url = http://example/home/comments/feed

charset = UTF-8
html_type = text/html
language = en-US
text_direction = ltr
version = 2.9.2

following is examples for using the bloginfo() method.

//Show Blog Description

//Show Blog Title

//ading the style.css
//ping back url
//for content type

How to use the bloginfo() function in wordpress theme
How to use the bloginfo() function in wordpress theme

accidentally deleted mysql root user

Some time back I accidentally deleted mysql root user. Then when checked mysql then mysql is not accessible to me from root user. I have the trick to restore mysql database.

accidentally deleted mysql root user

I am using the fedora 14 on my machine. After trying so many things at the end I found the solution.

use the following steps:

First I stoped mysql using following command.

#/etc/init.d/mysqld stop

Then I created one file with following conent

#file mysql_reset

UPDATE mysql.user SET Password=PASSWORD(‘newpassword’) WHERE User=’root’;

#mysqld_safe –init-file=/home/techiego/mysql-init &

Than again I stooped mysql process and restarted mysql. I was able to access my mysql again.

accidentally deleted mysql root user
accidentally deleted mysql root user

Import wordpress attachment without download images

Everybody knows how to use the wordpress import and export functionality. When you don’t want to download the wordpress post attachment (images, files) then you should follow my steps. Using following steps you are able to import all the attachment data without downloading the images.

Import wordpress attachment without download images

First Open your old wordpress installation and then go to wordpress panel. Then open your phpmyadmin of old wordpress installation and run following query.

update `wp_posts` set `post_type`='image' where `post_type`='attachment';
Import wordpress attachment without download images
Import wordpress attachment without download images

This query will create the image post type and attachments will become like post type. Then use the wordpress export and download exported xml.

 

Then open your new wordpress admin and click on import button and import the whole xml file.

You will see the you selected the download and import file attachments option but files are not downloaded.

Then through ftp client transfer all your image and files to new installation. Then open phpmyadmin of new wordpress panel and use following command.


update `wp_posts` set `post_type`='attachment' where `post_type`=image';

Now you are able to see the images in new wordpress panel and website.

Import wordpress attachment without download images
Import wordpress attachment without download images

Bluehost : Mailer Error: SMTP Error: Could not connect to SMTP host

I am using the bluehost for my some sites hosting. For sending emails I used the SMTP service which is provided by bluehost.

Bluehost : Mailer Error: SMTP Error: Could not connect to SMTP host

I used the PHPmailer in my website for sending email. When I tried to use the bluehost SMTP I always got the following error message.

Mailer Error: SMTP Error: Could not connect to SMTP host.”

I solved this issue. I created the following function.


<?php
include("class.phpmailer.php");

function mail_new($fun_to,$fun_subject,$fun_body,$fun_header,$fun_from,$fun_cc){
$mail = new PHPMailer();

$mail->IsSMTP();                                      // set mailer to use SMTP
$mail->Host = "mail.eparinay.com";  // specify main and backup server
//$mail->SMTPSecure = "ssl";                 // sets the prefix to the servier
$mail->SMTPAuth = true;     // turn on SMTP authentication
$mail->Username = "support@purabtech.in";  // SMTP username
$mail->Password = "YOURPSSSWORD"; // SMTP password
$mail->Port       = 26;

$mail->From = $fun_from;
$mail->FromName = "eparinay.com";
$mail->AddAddress($fun_to);
$mail->AddReplyTo($fun_from, $fun_from);

if($fun_cc!=""){
$mail->AddAddress($fun_cc);
}
$mail->WordWrap = 50;                                 // set word wrap to 50 characters
//$mail->AddAttachment("/var/tmp/file.tar.gz");         // add attachments
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");    // optional name
$mail->IsHTML(true);                                  // set email format to HTML

$mail->Subject = $fun_subject;
$mail->Body    = $fun_body;
//$mail->AltBody = "This is the body in plain text for non-HTML mail clients";

if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
}
?>

Where you want to use the mail you just need to include the above script and call the “mail_new” function for sending email through bluehost.

Bluehost - Mailer Error- SMTP Error- Could not connect to SMTP host
Bluehost – Mailer Error- SMTP Error- Could not connect to SMTP host

how to add virtual host in wamp server

In this tutorial we shown, how to add virtual host in wamp server on windows machine. You just need to follow our steps to setup virtual host in wamp server.

how to add virtual host in wamp server

Many PHP developers use the wamp server for development. For creating the virtual host just open the httpd.conf file from following location.

how to add virtual host in wamp server
how to add virtual host in wamp server


C:\wamp\bin\apache\Apache2.2.11

Then un-comment the following line


# Virtual hosts
Include conf/extra/httpd-vhosts.conf

Than open the httpd-vhosts.conf file from following location


C:\wamp\bin\apache\Apache2.2.11\conf\extra\

un-comment the following line


NameVirtualHost *:80

then put the following lines in that file



#ServerAdmin webmaster@dummy-host.localhost
DocumentRoot "C:/wamp/www"
ServerName localhost
ServerAlias localhost
ErrorLog "logs/localhost-error.log"
CustomLog "logs/localhost-access.log" common
<!--<span class="hiddenSpellError" pre="" data-mce-bogus="1"-->VirtualHost>


#ServerAdmin webmaster@dummy-host2.localhost
DocumentRoot "C:/wamp/www/wordpress"
ServerName wordpress.purab.com
ErrorLog "logs/wordpress.purab.com-error.log"
CustomLog "logs/wordpress.purab.com.log" common


Then restart the wamp server. Dont forget to update the hosts file from your system

Open the hosts file from following location.


C:\Windows\System32\drivers\etc

put entry like this.

127.0.0.1       localhost    localhost.localdomain    local.purabtech.in

Have fun!

free 40+ professional three column wordpress themes

people are searching 3 column themes. I found professional three column wordpress themes and I made a very nice and unique list of wordpress themes.

professional three column wordpress themes

Many people are sometimes searching for 3 column wordpress themes. I found professional 3 columns worpdress themes and I made a very nice list of wordpress themes. In this post you can view demo and for download theme you’ve to click on image of theme. So enjoy them and don’t forget to share! Thanks.

1. Pure Magazine

[ Demo ]

professional three column wordpress themes
professional three column wordpress themes

2. Bright-White

[ Demo ]

3. Blue News

[ Demo ]

4. Aristo

[ Demo ]

5. WP Premium

[ Demo ]

6. Freshblog

[ Demo ]

7. Fervens

[ Demo ]

8. Fantomalist

[ Demo ]

9. DailyPress

[ Demo ]

10. Carrington

[ Demo ]

11. Worn Wall

[ Demo ]

12. Work-a-holic

[ Demo ]

13. Unwind

[ Demo ]

14. Un.complicated

[ Demo ]

15. The Standard

[ Demo ]

16. The Morning After

[ Demo ]

17. Neoblue

[ Demo ]

18. Mercury

[ Demo ]

19. Magloss V2

[ Demo ]

20. Liliya

[ Demo ]

21. Grid Focus

[ Demo ]

22. The Daily Grind

[ Demo ]

23. Smooth

[ Demo ]

24. Shaken Grid

[ Demo ]

25. PixDesign Silver

[ Demo ]

26. Oxygenous

[ Demo ]

27. Mainam Vintage

[ Demo ]

28. Irresistible

[ Demo ]

29. Grass Roots

[ Demo ]

30. FREEmium

[ Demo ]

31. EcoNox

[ Demo ]

32. Demet

[ Demo ]

33. BlueBubble

[ Demo ]

34. Atlantis

[ Demo ]

35. Artwork

[ Demo ]

36. Welding

[ Demo ]

37. Solio

[ Demo ]

38. Simple Magazine Red

[ Demo ]

39. Riviera Magazine

[ Demo ]

40. Rewire Theme

[ Demo ]

41. Red Light Physics

[ Demo ]

42. Woodtastic

[ Demo ]

43. Simple Balance 2.0

[ Demo ]

44. Dilectio

[ Demo ]

Media Library not displaying images after importing posts

Earlier I have blog in wordpressmu  then after wordpress 3.0 version I decided to migrate to new version. I exported my all posts by using the wordpress  export tool. Then I imported data into new wordpress installation. I got all my posts and category and all the data. Then I checked all my attachments.

Then I saw my media library I saw all the images listing are there but images are not showing in media library. Media Library not displaying images after importing posts. I personally faced issue and got frustrated. then I solved issue myself using mysql query trick.

Media Library not displaying images after importing posts

Media Library not displaying images after importing posts
Media Library not displaying images after importing posts

When I checked my database I saw the all the my attachments are listed in post table but images are not displaying. All the places I only saw the wp-includes/images/crystal/default.png image.

I did spend one hour googled for solving the issue but I did not find any solution for this. Than again I checked my Folder permissions and images files but I found all things are perfect.
Then I checked my database and I found the issue. in wp_posts table ->post_mime_type column one entry was missing. After seeing that issue I fixed the issue.

I used the following mysql quires using myphpadmin tool.

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]

Update wp_posts set post_mime_type='image/jpg' WHERE guid like '%jpg%'
Update wp_posts set post_mime_type='image/jepg' WHERE guid like '%jepg%'
Update wp_posts set post_mime_type='image/png' WHERE guid like '%png%'
Update wp_posts set post_mime_type='image/gif' WHERE guid like '%gif%'

[/viral-lock]

After using above query I checked the my media library. I am able to see my all images in media library.

My advise to you is first take backup of your database and then use above mysql quires. Then use the above queries.

If you are imported post from other website then use following commands also.


UPDATE wp_posts SET post_content = REPLACE(post_content, 'NEW-DOMAIN-NAME', 'files/');

UPDATE wp_posts SET post_excerpt = REPLACE(post_excerpt, 'NEW-DOMAIN-NAME', 'OLD-DOMAIN-NAME');

UPDATE wp_posts SET guid = REPLACE(guid, 'NEW-DOMAIN-NAME', 'OLD-DOMAIN-NAME');

Above quires will change the domain location of file.

How to speed up wordpress blog or site

Many wordpress blogger always spending some time for speeding up there blogs. In this aritcle I will tell you how you can speed up your wordpress blog with easy steps. Loading your website is very important. If your blog or site not more fast then bounce rate of your website will be high.

 speed up wordpress blog

There is apache module called zlib. which is used for compression.

zlib is a lossless data-compression library that will help you to serve your pages faster. This will compress the static data of your website. like images, css and media and javascript files. It compresses the PHP that WordPress sends to your visitor’s browser so that it displays much more quickly. Compressing and sending is much faster than sending the PHP in its full size format.

 speed up wordpress blog
speed up wordpress blog

If you are using dedicated hosting service then easy to make changes in your files but if you are using the shared hosting then first you need to check zlib compression is available or not.

For checking zlib library create the phpinfo() file and see the zlib is there or not.

Mostly 99% shared hosting gives zlib compression facility. Just open your header.php file from your wordpres theme folder and following code in that file in top of file section.


<?php
ini_set(’zlib.output_compression’, ‘On’);
ini_set(’zlib.output_compression_level’, ‘1′);
?>

This change will save your bandwidth and webpage will load faster. you can see the result after doing this change. In my site I saw the difference.

Website will load 3 to 4 times faster than earlier.

 speed up wordpress blog
speed up wordpress blog

WordPress 3.0.3 released with Fixes issues

Some time before on 8th December WordPress released the New version which is 3.0.3. What wordpress is saying about this release.

WordPress 3.0.3 released with Fixes issues in the XML-RPC remote publishing interface

Wordpress 3.0.3 released with Fixes issues
WordPress 3.0.3 released with Fixes issues

This release fixes issues in the remote publishing interface, which under certain circumstances allowed Author- and Contributor-level users to improperly edit, publish, or delete posts.

These issues only affect sites that have remote publishing enabled.

Remote publishing is disabled by default, but you may have enabled it to use a remote publishing client such as one of the WordPress mobile apps. You can check these settings on the “Settings → Writing” screen.

With this release they Improved the capabilites checking in the XMLRPC code. They modified the following files.

wp-includes/version.php
xmlrpc.php
readme.html
wp-admin/includes/update-core.php

Enjoy the wordpress 3.0.3 version.