Corrupt .htaccess – 500 Internal Server Error wordpress installation !
Posted by Madhurie Singh on September 12, 2009
I was again at the end of my wits, rather even now I am lost ! :(
I was trying to make my 3 blogs installed in 3 different subdirectories. Since I have created one blog just for the homepage, I obviously want that subdirectory to be accessed by my domain name url, http://www.madhuriesingh.com. The homepage is in a subdirectory, called homepage.
So I tried to redirect the domain to point to my subdirectory calledd homepage, even when the called URL is http://www.madhuriesingh.com !
but when I tried to do a lot of redirects for testing purpose, I suddenly was not able to access the /wp-admin.php. I am getting this weird error, 500 Internal Server Error…..!!!!!!!!!!!
Now I can see from google search that, it’s pretty common problem with Apache Server.
This error occurs when the .htaccess file is corrupted.
Now a sharp experienced eye can make out from the error message what culprit is doing this mischief! But I will have to learn.
Creating and editing (.htaccess)
If you do not already have a .htaccess file, create one. If you have shell or ssh access to the server, a simple touch .htaccess command will create the file. If you are using FTP to transfer files, create a file on your local computer, call it 1.htaccess, upload it to the root of your WordPress folder, and then rename it to .htaccess.
You can edit the .htaccess file by FTP, shell, or (possibly) your host’s control panel.
If your .htaccess file contains errors that bring down your site (“Internal Server Error (500)”), you will need to use FTP or your host’s control panel to delete the rogue .htaccess file.
This para is from Codex site: Very clear:)
Automatically updating .htaccess
If WordPress can’t update your .htaccess file automatically, it will tell you something like If your .htaccess file were writable, we could do this automatically, but it isn’t… near the bottom of the Options → Permalinks panel.
If you want to let WordPress do this, you’ll need to give WordPress write access to the .htaccess file. The exact permissions necessary depend on your server setup. Try adding write permissions for the owner, then group, then world, testing after each change; once WordPress has edited the file successfully, don’t add any further write permissions.
After applying the permalinks, you should change the permissions to something stronger like 660 or 644 to prevent others on the server from potentially having access to it.
Read the next post where I explain how to go step by step and make changes to .Htaccess file.
This site tries to clarify a bit of my query.
But the best way is to do reading of .htaccess on my webhost help base.
This site gives steps of solution that I will now:
How To Fix The WordPress Internal Server Error
Here is what you need to do :
Back up your current .htaccess file.
Delete all of the information from your .htaccess file and save it i.e. upload a blank .htaccess file.
Your blog should now be usable again so go into the admin area and set your permalink structure again.
Open your new working .htaccess file in an editor. Now copy over all the non WordPress .htaccecss information from your old backed up .htaccess file eg. any search engine htaccess information, ip blocks etc – basically everything Non-WordPress that you added before.
If you find that adding all the code from the previous .htaccess file is causing an Internal Server Error again then remove it all and enter the information back to the working .htaccess file line by line to see what is causing the problem.
Bear in mind, this might not resolve every Internal Server Error you get though if you suddenly get this error on your WordPress blog, this is the first thing I recommend doing before contacting your host or looking for an alternative solution.
Copyright © 2009 Blogging Tips
I saw this site but do not know how to interpret it :(. Looks like I need to read about the .htaccess file thouroghly now.
One good way to avoid Internal Server Error is by using blog URL as the site URL which I want everyone to remember. I set this in the settings page.
The wordpress URL remains = http://www.madhuriesingh.com/homepage
The Blog URL changes = http://www.madhuriesingh.com
Then copy the index.php file from the subdirectory /public_html/webpage to root directory /public_html
That will avoid the redirection problem totally. Also it will avoid the usage of .Htaccess file for redirection path, as this .htaccess file will not be referred for redirection at all. This way the corruption of .htaccess file by redirection purpose is avoided :).
There are other reasons for the .htaccess file to get corrupted.
In case I activate a theme which has some kind of bug and internal redirection, the .htaccess file is referred to but, when it does not get the right path written down in the instructions, it assumes and goofs up by writing something garbage as path.
So I have learnt that I must not use any theme that is already not tried and tested and upload it only if it is recommended in wordpress.org site.
There are several free themes site from where I can easily download attractive themes. But since I have already encountered a major error (am I lucky) Internal Server Error, using Andreas09 theme that I downloaded from Andreas Viklund’s site, which is not in the available themes of the wordpress.org. I could see an error in the footer area of the activated Andreas 09 theme on my site.
So the moral of the error called 500 Internal Server Error,
1: when ever there is any redirection be ware, else .htaccess file will get corrupted.
2: when there is a theme to be activated, look for the most used and recommended theme only.
3: when trying to