• I’m running WordPress 5.1.1 on Ubuntu 18.04 with Apache2. I just reset my Permalinks setting from Plain to Post Name. Besides the home page, all the pages are now inaccessible. Most of them like <li>https://bootstrap-it.com/pluralsight-courses/</li> immediately return a 404, but some like <li>https://bootstrap-it.com/books/</li>will indefinitely retry.
    This is true for both old and entirely new pages.
    Nothing is showing up in Apache error logs.
    I’ve confirmed that mod_rewrite is enabled and tried removing the .htaccess file and resetting the Permalinks page. The file restores as it should, but there’s no change to the page behavior.
    In the meantime, just to make the site available, I’ve reverted to Plain permalinks. But I’m still unable to switch to Page Name.
    Any ideas?
    Thanks,

    • This topic was modified 5 years, 11 months ago by dlanced.
    • This topic was modified 5 years, 11 months ago by dlanced.
    • This topic was modified 5 years, 11 months ago by dlanced.
    • This topic was modified 5 years, 11 months ago by Steven Stern (sterndata).

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    Thread Starter dlanced

    (@dlanced)

    “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 5 years, 11 months 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?

    Thread Starter dlanced

    (@dlanced)

    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 https://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.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting 404 after changing permalinks settings’ is closed to new replies.