• Hi,

    PROBLEM: I am unable to get Permalinks with Postname working

    I am new to WordPress but not to Linux and support.

    System Description
    <strong>Ubuntu 18.04</strong> - Linux golf 4.15.0-20-generic #21-Ubuntu SMP Tue Apr 24 06:16:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

    WordPress
    WordPress 5.2.2 running Twenty Seventeen theme. ( I was running Twenty Ninteen but changed as advised in the sticky note on the forum)

    Web Server
    Apache Server version: Apache/2.4.29 (Ubuntu)

    MariaDB
    Server version: 10.1.41-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

    PHP Version

    HP 7.1.31-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug  7 2019 10:23:12) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.1.31-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

    Problem:
    I wish to use the much more user friendly pretty links but these give me the Apache 404 error.
    If i change to the Custom structure – /index.php/%year%/%monthnum%/%day%/%postname%/ – This works fine
    If I use the Plain structure that also works fine – /?p=xxx

    I have read the permalinks problems logged on this site but none of the options work for me.

    I have reinstalled WordPress multiple times. Each time i throw away the DB and start from scratch.

    I then login to WordPress and delete all plugins so I have none to get in the way of testing.

    My document root for WordPress is /var/www/html/
    This is where my .htaccess file is.

    # 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
    

    This file is updated as I can put entrys in it. Update permalinks and it gets updated
    -rwxr-xr-x 1 www-data www-data 236 Aug 27 02:40 /var/www/html/.htaccess

    Server is in Aus hence the time difference.

    My wp-config.php DB settings looks like so

    // ** MySQL settings - You can get this info from your web host ** //
    /** The name of the database for WordPress */
    define( 'DB_NAME', 'DB_NAME' );
    
    /** MySQL database username */
    define( 'DB_USER', 'DB_USER' );
    
    /** MySQL database password */
    define( 'DB_PASSWORD', 'PASSWORD' );
    
    /** MySQL hostname */
    define( 'DB_HOST', 'localhost' );
    
    /** Database Charset to use in creating database tables. */
    define( 'DB_CHARSET', 'utf8' );
    
    /** The Database Collate type. Don't change this if in doubt. */
    define( 'DB_COLLATE', '' );

    Apache is a standard install and the

    <VirtualHost *:80>
         ServerAdmin [email protected]
         DocumentRoot /var/www/html/
         ServerName xxx.yyyy.zzz
         ServerAlias someserver
    
         <Directory /var/www/html/>
            Options +FollowSymlinks
            <strong>AllowOverride All</strong>
            Require all granted
         </Directory>
    
         ErrorLog ${APACHE_LOG_DIR}/error.log
         CustomLog ${APACHE_LOG_DIR}/access.log combined
    
    </VirtualHost>

    SO this has the AllowOverride option set so the Webserver “Should” be reading the .htaccess file

    Any ideas what I am doing wrong as I’ve looked at this multiple times over the past 24 hours probably expending 6-8 hours testing forum posts

    Ta in advance

    Tom

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi Tom,

    Is mod_rewrite enabled in your apache configuration? This is the only thing I can think of that could cause this for you. The other things that could cause this are other plugins you have installed that could be breaking this. The rest of your configuration seems to be fine from what I can tell.

    Thread Starter twelsh37

    (@twelsh37)

    Hi Josh,

    Thanks for getting back to me.

    Damm, I was so hoping i had forgotten that. But nope. mod_rewrite is on

    # a2enmod rewrite
    Module rewrite already enabled

    Anything else?

    Regards

    Tom

    Thread Starter twelsh37

    (@twelsh37)

    Just to re-iterate I have deactivated and removed all plugins from my wordpress install and I still get this issue.

    Thread Starter twelsh37

    (@twelsh37)

    Hi All, So I still have not got a solution to this.

    I have now got a test system running on a VM on my Local PC.

    Its setup is the same as defined in the initial post.

    I have now cleared all plugins and all pages from my setup. If I load the site I get my Hello World standard post and the new one I created called test.

    I have changed the permalink to postID and it works but if you change it to pastname it breaks and returns a 404.

    I have carried out the following today

    1. Updated apache config AllowOverride from None -> All

    2. Deleted my .htaccess file and recreated it via WordPress by changing between Permalink types.

    3. If editing a post in wp-admin and you click on the Preview button or the preview link you get two different outcomes.
    a) Preview Button – This just goes to the preview page and the WordPress logo just shimmers. No preview is delivered.
    b) Preview link – If I click on the preview link which has the post format I want – https://192.168.1.179/wordpress/test/ – it returns a 404. Pressing the back arrow in the browser brings you back to the posts page and shows an “Updating failed” message.

    4. I am using the TwentyNinteen theme but having been through multiple themes I get the same error everywhere.

    I have upped the memory on my VM from 512MB to 1GB as suggested for the previewing A error but that did not fix the issue.

    I have now read multiple posts on fixing this 404 error and I can safely say it is not the standard error. Simply switching between permalink types does not fix the error.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PROBLEM: I am unable to get Permalinks with Postname working’ is closed to new replies.