I solved this problem by following these steps:
Step 1. Rename "config-dist.php" to "config.php"
Step 2. Enter the value manualy in config.php for the following variables.
save and upload in your moodle root folder.
I hope it will work fine and no need to create .htaccess file.
Please refer config.php file for more details.