500 Internal Service Error in codeigniter on sub domain

August 18, 2017 835 views
Apache PHP PHP Frameworks Ubuntu 16.04

I had an admin panel written in codeigniter on my website root folder say example.com. Then I needed to move it to a sub directory named admin so i can upload my main website on the root folder. the admin panel was now on example.com/admin/.
Then i created a subdomain for my website named admin.example.com and pointed it to my sub directory named admin. But when i tried to visit admin.example.com it gives a 500 internal server error. I thought it was due to .htaccess but my .htaccess file has this code:

<IfModule authz_core_module>
    Require all denied
<IfModule !authz_core_module>
    Deny from all

Now i don't know whats causing the problem ?
The original working was that when someone visited the example.com he was redirected to example.com/auth/ and same happens when someone visits the admin.example.com he is redirected to admin.example.com/auth/login.
I even tried to change the base path in codeigniter config.php to $config['base_url'] = 'http://admin.example.com/'; but it is not working. So please let me know if someone can help.
The only solution i found was that move the whole admin panel back to root folder but it is now good as i have to host a static website there.
I am waiting for your answers.

1 Answer

Sorry to see that your question hasn't received an answer yet. Unfortunately, after this much time, it is unlikely that an answer for this specific question will be provided. For people still landing here via search, a good first step when receiving a 500 Internal Server error is to check Apache's error logs for more information. This command will print the last (most recent) 50 lines of the log file:

sudo tail -n 50 /var/log/apache2/error.log
Have another answer? Share your knowledge.