Host Images on Subdomain For Better Performance is a Good Idea To make your Blog Or Website load faster and will make the user Experience Stream-less. It is obviously that this is just one of the things to carry out which will lead to images load faster. To Host Images On Sub Domain you need to have access to the cPanel of Your Webhosting.
Create a Subdomain for your Site
Once You Login Your Cpanel You Need To Create a Sub Domain. Move to Sub-Domains Section to get your sub-domain.
Point to Subdomains and create your subdomain To Host Images and provided your domain resides under /public_html/.
Note: The access depends on your hosting provider. So if you are unable to create a subdomain then you should hosting provider.
Change Default Image Uploading Folder Path in WordPress.
This step involves in setting WordPress to change the default uploading folder for the post images. log-in to your WordPress dashboard. Click on “Media” under “Settings” from left side of the dashboard.
Fill up the fields as follows: Store uploads in this folder : images Full URL path to files : http://images.yourdomain.com
Click on “Save Changes”. Now when you will upload any image to your post, the images will be uploaded in the subdomain http://images.yourdomain.com.
Update the old post images Location
You’ve just changed the upload location of your post images. So the images of the new posts will be uploaded in the subdomain. But what about the old post images? Changing the location of all the old images one by one is a stupid job. So at first download all the folders containing the images under /public_html/wp-content/uploads/ from your server.
Upload all those folders in the folder /public_html/images/. Now you have to execute a simple SQL query on your database. You can do this from the phpMyAdmin in your domain control panel.
Click on phpMyAdmin > select your database from the left side > click on the “SQL” tab.
Now put the following query in the box
UPDATE wp_posts SET post_content = REPLACE(post_content,
Click on “GO”. This query will replace “http://www.yourdomain.com/wp-content/uploads/” with “http://images.yourdomain.com/” in all the image location url. To update the images links in the media library run the following sql command.
UPDATE wp_posts SET guid = REPLACE(guid,'http://www.yourdomain.com/wp-content/uploads/','http://images.yourdomain.com/')
Redirect the old images link to New Host Images on subdomain
So Now the task is completed at your site and database but Google has crawled and indexed your old images and not changing that will affect your Page-Rank in a later. So redirect the old image urls to the new image urls to let Google know that those images are same. To do so add the following line in your .htaccess file.
RedirectMatch 301 ^/wp-content/uploads/(.*)$ http://images.yourdomain.com/$1
Important Note: Backup your .htaccess file before any change. That’s all to set your subdomain as post-images upload location. Any questions you can ask on comments. Share your opinion in the comments or Join Us At Google+ / Facebook.
Incoming search terms:
- host images on sub-domain wordpress blog
- wordpress images subdomain
- social picture subdomain fast?
- wordpress move images to subdomain
- wordpress how to specify image subdomain
- wordpress store images in a subdomain
- wordpress subdomain image upload
- wordpress upload media to subdomain
- wordpress upload subdomain
- change image to subdomain