最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

apache - Removed index.php now all pages with Internal Server Error

programmeradmin1浏览0评论

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

Share Improve this question asked May 27, 2019 at 19:35 FabioBFabioB 31 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

I 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.

发布评论

评论列表(0)

  1. 暂无评论