Wednesday, September 5, 2012

Wordpress Database Not Working After Changing The Permalink From The Settings.

Hello Everyone,

Today I have come up with another, wordpress related issues, regarding the database and permalink. So, before i start i would like to infrom you that, this solution is tested in Godaddy Server, may other servers may have some different way to resolve it.

So, it started when i changed the permalink from the settings area, initially it was Default, i changed it to "/archives/%post_id%" and the problem started, i was unable to open the website in the browser anymore, it started showing me the 500 Internal Server Error.

I checked my database if, by changing the permalink manually from there would work, but was unsucessful.
Then, i opened the wordpress wp-config.php to check all the connectivity credentials and found all was correct.
While checking this in the FTP, I found there, an auto generated XML file named "web.config" with the content related to rewrite rules for wordpress.

Although the web.config file doesn't show any extension name, i opened it in Dreamweaver.
Then I removed it from the folder, deleting this file and setting the permalinks blank from the database solve my problem and my website started working.
Then again I checked in the FTP and found that there was no web.config file over there. But changing the permalinks is creating this and then the problem starts, I still didn't find a way to this problem, may be I have some redirect plugins installed in my wordpress may causing this. Will let you know, when I get a clue to this. Still then stay tuned. Will discuss more daily real time issues over there.

Hope it will help few of you!!!
Please share if you guys get some clues.

Monday, August 13, 2012

How to use same Database for different wordpress installed?

Hello Everyone,
Sometimes we have some big projects in wordpress where we require clients feedback on every update, for new website which is not yet live, is fine but for live sites if changes are frequent we require some testing website to test our functionality, before making the changes in the live website.
So, I am sharing with all of how to do this.

Assuming that your website is live now for testing purpose you are building another duplicate.
Say your live url is :http://www.yourdomain.com

Step1: Create a folder in the root so that you can open it as http://www.yourdomain.com/duplicate

Step2: Copy the whole website there, even the wp-config.php should be same.

Step3: Go to wp-includes/wp-db.php go around line no. 598 (Wordpress 3.3) or I will say to find
function set_prefix there where the foreach loop ends add $this->options = 'wpdup_options'; where "wpdup" is the new prefix which we set for the new installation.

Step4: Go to your phpmyadmin, duplicate the wp_options table and edit it with table name as wpdup_options and there change the options as required, say in option_name where there is "siteurl" put the option_value as "http://www.yourdomain.com/duplicate".

Step5: Check that all the links are directed to the new link, and you are done.

Hope it will help you!!!