What happens when permalink settings are updated?

Question

I have to identical copies of the same site on two different webhosting companies (besides the actual domain of course). One of them works all the time with pretty permalinks and the other works fine a day or so, but then all of a sudden it does not work and the permalink gives an 404 file not found, but only when viewing a singe custom post page, named single-<cpt-name>.php in the thems folder.

When I go into admin / Permalink page – the sites starts to work again (with the custom post page showing again)

My thoughts are that this must be server-related. The site that is working all the time has PHP 5.4 and the one that is not working all of the time has PHP 5.5, but I don’t think the version of PHP is the issue. Both sites have WP 3.8.

I’m using a cacheplugin called WP Supercache, but that doesn’t seem to be the issue because the site works again with cpt without flushing the cache (after viewing permalinksettings in admin)

I’m using permalink-structure: /%postname%/

I’m wondering how I could debug this? In order for me to debug this I want to know what happens (programmatically) when peramlink-settings are updated? I think that the .htaccess in the root-folder (same as wp_config.php) is changed. (based on some reading) Is this correct?

I’m wondering if some plugin can cause the issue? (a plugin that somehow messes up pretty permalinks somehow)

My .htaccess looks like this (when working):

# 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
0
, bestprogrammerintheworld 6 months 0 Answers 71 views 0

Leave an answer