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.
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
Displays information about your blog, mostly gathered from the information you supply in your User Profile and General Options from the WordPress Administration panel.
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’;
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
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
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
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
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
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.
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
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.
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
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.
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
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.