• I moved my simple, static site from a (multi-site) hosted provider to my own local server. The home page renders fine, and I can get to the content of the other few pages, but not using the menus/permalinks. When using the main (permalink) menus to access the other pages, I get 404 (page-not-found) errors.

    Example: https://www.dovercottage.com.au/attractions fails
    However: https://www.dovercottage.com.au/?s=attractions is OK.

    Looking at the page source, all the links seem to reference the correct database pages, i.e. reference the page IDs returned from this query:

    mysql> select ID,post_name,post_type,post_title from wp_posts where post_type="page";

    The permalink settings use /%category%/%postname%/; the top-level .htaccess is as per the usual permalinks configuration (copied from the previous working site) and I see no other apache2 errors.

    I’m not sure how the mod-rewrite/permalinks process works and I can’t see where else to look for configuration errors, etc, so I’d appreciate a few pointers to tell me what I might have done wrong. (Thanks!)

Viewing 3 replies - 1 through 3 (of 3 total)
  • if you are using apache web server then you need to have mod_rewrite enabled and this code added in .htacess

    # 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

    if this doesnt seem to work. please check this article
    https://codex.www.ads-software.com/Using_Permalinks#Using_.22Pretty.22_permalinks

    Thread Starter FreddyFarkleberry

    (@freddyfarkleberry)

    Yes, apache 2.4.10 on debian testing. rewrite module is enabled.
    site configuration snippet as follows:

    <Directory /path/to/www.dovercottage.com.au/wp-content>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
    </Directory>

    At top level, i.e. /path/to/www.dovercottage.com.au/, there is a .htaccess file with those exact contents, permissions: 0644.

    I didn’t see anything else in that link that would help, but permalinks are still broken. What next?

    Thread Starter FreddyFarkleberry

    (@freddyfarkleberry)

    One clue could be the apache <Directory .../> directive applied to the wp-content subdir of the site, but the .htaccess and index.php were in the directory above. Would that matter? (I tested removing the wp-content from the end of the path, but it made no noticable difference.)

    Also, wordpress complains about the .htaccess file not being writable. I changed the permissions to 0666 (ownership is www-data.root), but still wordpress complains. (directory is owned by www-data.)

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Moved site; now permalinks give 404s’ is closed to new replies.