I'm coding a theme from an HTML template. Initially, I just removed the index.php with the .htaccess as the answer shows.
Now I have "Internal Server Error" even on the homepage, that was working before that.
I already tried to change my permalinks a thousand times. Don't know what to do anymore.
I'm using the latest WP version, 5.2.2 I guess. I'm locked out of the dashboard. but I have wp-cli if it could help.
Thanks for any help!
This is my apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
My .htaccess in /var/www/html/site2.localhost/public_html/
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
I'm coding a theme from an HTML template. Initially, I just removed the index.php with the .htaccess as the answer shows.
Now I have "Internal Server Error" even on the homepage, that was working before that.
I already tried to change my permalinks a thousand times. Don't know what to do anymore.
I'm using the latest WP version, 5.2.2 I guess. I'm locked out of the dashboard. but I have wp-cli if it could help.
Thanks for any help!
This is my apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
My .htaccess in /var/www/html/site2.localhost/public_html/
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
1 Answer
Reset to default 0I just found the answer.
Firstly, I look out for an apache error log in /var/log/apache2
, on the file error.log.1 I found these last lines:
[Sun May 26 22:46:23.694952 2019] [core:alert] [pid 8436] [client ::1:52840] /var/www/html/site2.localhost/public_html/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration, referer: http://site2.localhost/wp-admin/edit.php?post_type=page
[Mon May 27 00:08:19.614216 2019] [mpm_prefork:notice] [pid 8418] AH00171: Graceful restart requested, doing restart
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
Searching for "Invalid command 'RewriteEngine'", I found this thread that has an answer to the question:
Look for the file rewrite.load on /etc/apache2/mods-enabled
, if you didn't find the file, run sudo a2enmod rewrite
and after restart apache with sudo service apache2 restart
.
Now the file rewrite.load appears on the /etc/apache2/mods-enabled
directory and I just refresh the browser to everything back to normal.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745458805a4628612.html
评论列表(0条)