How to Solve 500 internal server error in wordpress

Share this Article :


If your blog is developed on wordpress, and if you have your blogs on  subdomains  and now looking to change it to  subfolders ? hmm

you can do that very easily, but once if you change it to subfolder  For example    From  http://abc.domain.com  to   http://www.domain.com/abc/    is very easy ..  but,  did you cross chekced  what happens to your posts ?? will your posts are accessible ?? are they working ??  Mostly  the answer is No.

Here  is the guide  which will help you to solve  your  subdomain to subfolder issue  in wordpress  but,  for this you should play with CPANEL  or  other Hosting Control .

Step 1: Lets  assume   you have created  subdomain  abc   pointing  to  abc folder  in the directory structure of  your  Files on Hosting ..

i.e      xxxxxx/abc/

Step 2: Lests  assume you have installed wordpress in  abc/  folder  .

Step 3: Change  the  Blog URL  From    http://abc.domain.com   to  http://www.domain.com/abc/   From Settings  in  wordpress

Step 4: Now,  what to do with  the  Google index pages  on   Subdomains ??  For this  ..   Go to subdomains   From the Domain Management  Page   and   for the subdomain  change the  pointing  folder  to  abc1/

i.e     Now  abc  subdomain  should  point to   abc1  folder     where in earlier  it was pointing  to  abc  folder  …

Step 5 : Now  create  a  .htaccess file in  newly created  folder abc1/  and  place the following  code

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Step 6: The Last  Step  Create  index.php  file in abc1  folder   and  paste in the follwing  code

<?php
$url=$_SERVER["REQUEST_URI"];
header(“location:http://www.domain.com/abc/”.$url);
?>

You  are done.  Your  Subdomain  to subfolder  problem  and  500 internal server error  will be seen no more .

What  happes with this  procedure  is  :

Lets  say …  You have a Page  indexed in Google .

ex :.  http://abc.domain.com/my-own-page.php

Once after you switch to  normal  subfolder s tructure  i.e  http://www.domain.com/abc/my-own-page.php .   But  still   Your  Traffic   From Google will be on  http://abc.domain.com/my-own-page.php  user  will get 500 or  internal server error    .

With  the above  SOlution  what  happes ins …    the URL    http://abc.domain.com/my-own-page.php   will be redirected  to  http://www.domain.com/abc/my-own-page.php

So, You wont  loose your  Users  .. who want to see the page .

All the Best  ..

Written by adrevol

{adrevol has written 91 posts on ITTreats.com . See all posts by }


Leave a Reply