I’ve confirmed that mod_rewrite is enabled and tried removing the .htaccess file and resetting the Permalinks page.
Just to recap and make sure we’re on the same page: I think in most cases when operating correctly, “sudo a2enmod rewrite” should probably return “Module rewrite is already enabled”. Assuming that is your result as well, make sure you’ve also added the “AllowOverride All” directive in your Apache virtual host configuration for the site. Once that’s done, the server will need to be restarted for the changes to take effect. “sudo service apache2 restart” should probably do it.
“sudo a2enmod rewrite” does indeed return “Module rewrite is already enabled”. and “AllowOverride All” is set for my virtual host directive (and for the /var/www directive, too – I assume that’s not a conflict). I’ve restarted Apache a number of times through the afternoon and evening. Unfortunately, I’m still having the same trouble when I set Permalinks to Post Name.
By the way, I’ve seen references in other forum threads to possible conflicts with the theme you use. So just to be clear, I’m using the Twenty Seventeen theme.
Thanks!
-
This reply was modified 7 years, 1 month ago by
dlanced.
Are you serving only one site from /var/www/html using the default Apache virtual config? If so, in general (your info may vary) if you configured the default site: /etc/apache2/sites-available/000-default.conf – the Directory config would at minimum probably look something like this for permalinks to work:
DocumentRoot /var/www/html
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
Is that similar to what you have in the virtual host config?
I’m actually serving multiple sites from that server. But there was no Directory listing within this site’s VirtualHost. So I added the Directory listing within my site’s VirtualHost as follows:
<VirtualHost *:80>
ServerName bootstrap-it.com
DocumentRoot /var/www/html/bootstrapit
<Directory /var/www/html/bootstrapit>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ServerAlias http://www.bootstrap-it.com
</VirtualHost>
For some reason, the .htaccess was emptied out so I rebuilt it as follows:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
My site is accessible, but still won’t find pages with Permalinks set to Post Names. I did try adding Option Indexes to .htaccess, but that prevented even the home page from loading.