Support » Fixing WordPress » Unable to resolve 404 errors after saving permalink settings and rewrite rules

  • Resolved jonrobertson

    (@jonrobertson)


    I am new to WordPress and recently installed it on a local web server. My server is running Raspbian and Apache 2.4.38.

    My WP site is currently very small as I’m just getting started. Aside from the home page, it has one static page and one post. Last night, going to those pages results in a 404 error.

    Any help or guidance would be greatly appreciated!

    Chrome shows this:

    Not Found
    The requested URL was not found on this server.
    Apache/2.4.38 (Raspbian) Server at c64-geek.ddnsgeek.com Port 443

    After searching online, I’ve tried the following:
    – switched to troubleshooting mode, with all plug-ins disabled and default theme active (TwentyTwenty)
    – enabled WP debug logging and checked the log file for possible clues
    – changing/saving permalinks settings multiple times
    – changed permission on .htaccess and save permalink settings
    – verified that .htaccess has the expected code
    – verified that mod-rewrite is installed and active
    – restarted apache
    – cleared browser cache and did a hard-refresh (ctrl-F5)

    None of that has solved the issue for me.

    There is one theme-related error in the WordPress debug.log when loading the home page, but nothing new when trying to go to the problem pages. That error is:

    PHP Notice:  Undefined variable: widget_footer_width in /var/www/html/wp/wp
    -content/themes/potter/inc/customizer/styles.php on line 2567

    After restarting apache and trying to load the page, apache’s access.log contains:

    192.168.1.254 - - [14/May/2020:23:56:26 -0500] "GET /wp/amiga-2000hd/ HTTP/1.1" 404 4301 "https://c64-geek.ddnsgeek.com/wp/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"
    192.168.1.254 - - [14/May/2020:23:56:26 -0500] "GET /favicon.ico HTTP/1.1" 404 526 "https://c64-geek.ddnsgeek.com/wp/amiga-2000hd/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36"

    Nothing is written to apache’s error.log when attempting to load the page.

    Below is the full text of Site Health Info:

    Notice:  Array to string conversion in /var/www/html/wp/wp-content/plugins/health-check/includes/class-health-check-debug-data.php on line 1172
    
    ### wp-core ###
    
    version: 5.4.1
    site_language: en_US
    user_language: en_US
    permalink: /%year%/%monthnum%/%day%/%postname%/
    https_status: true
    user_registration: 0
    default_comment_status: open
    multisite: false
    user_count: 1
    dotorg_communication: true
    
    ### wp-paths-sizes ###
    
    wordpress_path: /var/www/html/wp
    wordpress_size: 39.59 MB (41511611 bytes)
    uploads_path: /var/www/html/wp/wp-content/uploads
    uploads_size: 3.70 MB (3883226 bytes)
    themes_path: /var/www/html/wp/wp-content/themes
    themes_size: 20.76 MB (21764485 bytes)
    plugins_path: /var/www/html/wp/wp-content/plugins
    plugins_size: 111.90 MB (117336140 bytes)
    database_size: 2.28 MB (2392064 bytes)
    total_size: 178.23 MB (186887526 bytes)
    
    ### wp-active-theme ###
    
    name: Potter (potter)
    version: 1.1.6
    author: wppotter
    author_website: (undefined)
    parent_theme: none
    theme_features: custom-logo, custom-background, title-tag, post-thumbnails, automatic-feed-links, html5, customize-selective-refresh-widgets, menus, editor-styles, align-wide, editor-font-sizes, header-footer-elementor, widgets
    theme_path: /var/www/html/wp/wp-content/themes/potter
    
    ### wp-themes-inactive (8) ###
    
    Library Books: version: 1.5, author: sinsikha
    MH Magazine lite: version: 2.8.6, author: MH Themes
    MH RetroMag: version: 1.0.1, author: MH Themes
    Polestar: version: 1.4.0, author: Puro
    SiteOrigin Corp: version: 1.16.1, author: SiteOrigin
    SMNTCS Retro: version: 1.9, author: Niels Lange
    Twenty Twenty: version: 1.2, author: the WordPress team (latest version: 1.3)
    Vantage: version: 1.14.5, author: SiteOrigin
    
    ### wp-mu-plugins (1) ###
    
    Health Check Troubleshooting Mode: author: (undefined), version: 1.7.1
    
    ### wp-plugins-active (7) ###
    
    Akismet Anti-Spam: version: 4.1.5, author: Automattic
    Classic Editor: version: 1.5, author: WordPress Contributors
    Health Check & Troubleshooting: version: 1.4.4, author: The WordPress.org community
    Page Builder by SiteOrigin: version: 2.10.16, author: SiteOrigin
    SiteOrigin Widgets Bundle: version: 1.16.1, author: SiteOrigin
    UpdraftPlus - Backup/Restore: version: 1.16.23, author: UpdraftPlus.Com, DavidAnderson
    WPForms Lite: version: 1.6.0.1, author: WPForms
    
    ### wp-plugins-inactive (15) ###
    
    Autoptimize: version: 2.7.1, author: Frank Goossens (futtta)
    bbPress: version: 2.6.4, author: The bbPress Contributors
    BuddyPress: version: 5.2.0, author: The BuddyPress Community (latest version: 6.0.0)
    Download Manager: version: 3.0.96, author: W3 Eden
    Elementor: version: 2.9.8, author: Elementor.com
    Glue for Yoast SEO & AMP: version: 0.6, author: Joost de Valk
    LiteSpeed Cache: version: 3.0.8.6, author: LiteSpeed Technologies (latest version: 3.0.9)
    Multiple Themes: version: 7.1.1, author: David Gewirtz
    Simple File List: version: 4.2.7, author: Mitchell Bennis
    TablePress: version: 1.11, author: Tobias Bäthge
    WordPress Importer: version: 0.7, author: wordpressdotorg
    WP-Optimize - Clean, Compress, Cache: version: 3.0.19, author: David Anderson, Ruhani Rabin, Team Updraft
    WP Fastest Cache: version: 0.9.0.6, author: Emre Vona
    WP Maintenance Mode: version: 2.2.4, author: Designmodo
    Yoast SEO: version: 14.0.4, author: Team Yoast (latest version: 14.1)
    
    ### wp-media ###
    
    image_editor: WP_Image_Editor_Imagick
    imagick_module_version: 1690
    imagemagick_version: ImageMagick 6.9.10-23 Q16 arm 20190101 https://imagemagick.org
    imagick_limits: 
    	imagick::RESOURCETYPE_AREA: 122 MB
    	imagick::RESOURCETYPE_DISK: 1073741824
    	imagick::RESOURCETYPE_FILE: 6144
    	imagick::RESOURCETYPE_MAP: 512 MB
    	imagick::RESOURCETYPE_MEMORY: 256 MB
    	imagick::RESOURCETYPE_THREAD: 4
    gd_version: 2.2.5
    ghostscript_version: 9.27
    
    ### wp-server ###
    
    server_architecture: Linux 4.19.97-v7l+ armv7l
    httpd_software: Apache/2.4.38 (Raspbian)
    php_version: 7.3.14-1~deb10u1
    php_sapi: apache2handler
    max_input_variables: 1000
    time_limit: 30
    memory_limit: 256M
    max_input_time: 60
    upload_max_size: 2M
    php_post_max_size: 8M
    curl_version: 7.64.0 OpenSSL/1.1.1d
    suhosin: false
    imagick_availability: true
    server-headers: 
    	date: Fri, 15 May 2020 04:27:16 GMT
    	server: Apache/2.4.38 (Raspbian)
    	expires: Wed, 11 Jan 1984 05:00:00 GMT
    	cache-control: no-cache, must-revalidate, max-age=0
    	link: Array
    	vary: Accept-Encoding
    	content-encoding: gzip
    	content-length: 6413
    	content-type: text/html; charset=UTF-8
    htaccess_extra_rules: false
    
    ### wp-database ###
    
    extension: mysqli
    server_version: 10.0.28-MariaDB-2+b1
    client_version: mysqlnd 5.0.12-dev - 20150407 - $Id: 7cc7cc96e675f6d72e5cf0f267f48e167c2abb23 $
    
    ### wp-constants ###
    
    WP_HOME: undefined
    WP_SITEURL: undefined
    WP_CONTENT_DIR: /var/www/html/wp/wp-content
    WP_PLUGIN_DIR: /var/www/html/wp/wp-content/plugins
    WP_MAX_MEMORY_LIMIT: 256M
    WP_DEBUG: true
    WP_DEBUG_DISPLAY: true
    WP_DEBUG_LOG: true
    SCRIPT_DEBUG: false
    WP_CACHE: false
    CONCATENATE_SCRIPTS: undefined
    COMPRESS_SCRIPTS: undefined
    COMPRESS_CSS: undefined
    WP_LOCAL_DEV: undefined
    
    ### wp-filesystem ###
    
    wordpress: writable
    wp-content: writable
    uploads: writable
    plugins: writable
    themes: writable
    mu-plugins: writable
    
    ### wpforms ###
    
    version: 1.6.0.1
    license: false
    lite: May 12, 2020 @ 2:43am
    total_forms: undefined
    total_entries: undefined

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    The .htaccess rules are not being honored. It is possible for your server to be configured to not allow any .htaccess overrides. WP cannot operate under such conditions. You might try adding a simple redirect rule to a known HTML file as a test. If that fails too, you need to alter the Apache configuration file. See
    https://stackoverflow.com/questions/18740419/how-to-set-allowoverride-all#22526144
    for specifics, keeping in mind the directory paths for your installation may be different.

    Thank you.

    I previously added a separate entry for wp. However, I double checked that based on your response and realized that I added it as

    <Directory /var/www/wp/>

    rather than /var/www/html/wp.

    As of now, I don’t see any reason to restrict allowoverride to just wp, so I removed that entry and modified the primary entry for /var/www and it is working now.

    Thank you very much. I’m very new and green to both Linux and Apache. It is frustrating to spend so much time trying to fix something when the solution was so simple. But, I learn more from resolving issues than I do from setting up stuff that “just works”. 😀

    Moderator bcworkz

    (@bcworkz)

    You’re welcome. I’m not new to Apache and Linux, yet I’m still often frustrated by what I don’t know and silly errors resulting from that. Frustration comes with the territory I think. The bright spot in all of this is hard won knowledge is usually well remembered knowledge 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Unable to resolve 404 errors after saving permalink settings and rewrite rules’ is closed to new replies.