3

I installed Magento2.2. After installing when I visit the site, it shows

500 Internal Server Error

The same for admin section as well.

I removed my .htaccess from root folder and tried. This time around front end loads without css and js, but admin section shows

404 Not Found

Can someone help?

I referred below but no luck.

Css and admin panel not working in Magento 2 Community Edition

My Apache error log says

[Sun Jan 21 16:40:19.568718 2018] [core:alert] [pid 12172:tid 1100] [client ::1:56158] D:/wamp/www/anto/certification/magento2/.htaccess: Invalid command IfVersion, perhaps misspelled or defined by a module not included in the server configuration,

4
  • Please check server log. where you can get cause of it Commented Jan 21, 2018 at 12:30
  • @PramodKharade I updated my log
    – Anto S
    Commented Jan 21, 2018 at 12:43
  • run this command and update composer once : php bin/magento setup:upgrade,php bin/magento setup:static-content:deploy , give permission check. Commented Jan 21, 2018 at 12:46
  • 1
    @PramodKharade your hint helps. I need to enable mod_version in httpd.conf
    – Anto S
    Commented Jan 21, 2018 at 12:50

3 Answers 3

5

For 500 error, you need to enable mod_version in apache.

You can check all the enabled apache modules with the command apache2ctl -M. If you don't see it in the list, then it's not installed.

To do this run the command a2enmod version as the root user, or sudo a2enmod version as a non-root user and then reload apache with apache2ctl reload.

For 404 error regarding css and js, you can try changing:

Options +FollowSymLinks

to

Options +SymLinksIfOwnerMatch

in the .htaccess file located in the following locations:

  • your Magento root install directoy (this is usually the /www/ or /public_html/ folder)
  • /pub/
  • /pub/static/
  • /pub/media/
1
  • 1
    Thanks for your time. Enabling mod_version.so fixed the issue. +1 for your support.
    – Anto S
    Commented Jan 21, 2018 at 13:09
4

As per the suggestion given by @Pramodkharade on comments, I need to enable mod_version module from my httpd.conf

Change below

# LoadModule version_module modules/mod_version.so

To

LoadModule version_module modules/mod_version.so

And the restart apache this will fix the issue.

3
  • 1
    If @Lez answer helped you then you must mark that answer as supported rather posting as a answer.
    – inrsaurabh
    Commented Jan 21, 2018 at 14:26
  • Indeed, what @Lez posted should be marked as answer, not your own post, lol.
    – Lanius
    Commented Mar 12, 2019 at 8:04
  • 1
    @talonkingvskg Done.
    – Anto S
    Commented Mar 12, 2019 at 8:07
0

magento2 .htaccess problem after server migration from siteground to godaddy. internal server error on image,css,js and my website is http://mastee.in/

i have migrated from siteground hosting to godaddy. and i dont have access to any image, links, css, js files . i am guessing the problem is with .htaccess file

can anyone address what went wrong?

.htaccess file

RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} ^$ [OR]
RewriteCond %{HTTP_USER_AGENT} (bot|crawl|robot)
RewriteCond %{HTTP_USER_AGENT} !(bing|Google) [NC]
RewriteRule ^/?.*$ "http\:\/\/127\.0\.0\.1" [R,L]
# BLOCK BLANK USER AGENTS
RewriteCond %{HTTP_USER_AGENT} ^-?$
RewriteRule ^ - [F]

error with all css,images,js files

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>500 Internal Server Error</title>
</head><body>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error or
misconfiguration and was unable to complete
your request.</p>
<p>Please contact the server administrator at 
 [email protected] to inform them of the time this error occurred,
 and the actions you performed just before this error.</p>
<p>More information about this error may be available
in the server error log.</p>
<p>Additionally, a 500 Internal Server Error
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.