Support » Installing WordPress » .htaccess file is incomplete after fresh install

  • Hey there,

    we just noted a problem we never had before. When we install a fresh WordPress on the same server we already host about 100 other installations the .htaccess file isn’t set up correctly.

    We know the .htaccess as follows after a fresh installation:

    # BEGIN WordPress
    # Die Anweisungen (Zeilen) zwischen <code>BEGIN WordPress</code> und <code>END WordPress</code> sind
    # dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
    # Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    <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

    But in our current fresh installation the whole <IfModule>-Part is missing. Instead there are only the comments:

    # BEGIN WordPress
    # Die Anweisungen (Zeilen) zwischen <code>BEGIN WordPress</code> und <code>END WordPress</code> sind
    # dynamisch generiert und sollten nur über WordPress-Filter geändert werden.
    # Alle Änderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    # END WordPress

    We even deleted the whole installation and retried it – with no outcome. It stayed like this with the missing code part.

    As said above: We host on the very same machine about 100 WordPress installations – and nowhere we have had this problem.

    Additionally: When I try to add the <IfModule>-Part manually to the .htaccess file then web access to…

    https://URL.TLD/admin

    …isn’t routed to https://URL.TLD/wp-admin anymore. Instead the WordPress tries to open a page named /admin/ (that is of course not there).

    As said: It is a completely fresh installation. Is anyone out there who has an idea what happens here and what we could try to investiagte to fix this issue?

    PS: When we try to access https://URL.TLD/admin on another domain on the same server, it gets routed to /wp-admin/ without any problems – as it has always been.

    Many thanks in advance for any help,
    -doffine

Viewing 2 replies - 1 through 2 (of 2 total)
  • I use that

    /admin/

    to test for the presence of a working htaccess as the default WordPress htaccess creates that.

    Quick fix is to setup permalinks and see if that triggers a new htaccess creation.

    From there WordPress will (should) create and write the new htaccess or show you what you need to add yourself. WordPress can’t create htaccess if the permissions or owner are not set properly.

    Hey @jnashhawkins,

    there you are on the right path. If I set up permalinks, then the correct .htaccess is generated. But now I wonder, why this doesn’t happen when I install the fresh WordPress. It has always happended then. I never had to primarily save a permalink setting after WordPress installation to cause .htaccess generation.

    What is interesting: When I set the permalinks back to “Plain” the .htaccess code disappears from the .htaccess file.

    Many greetings,
    -doffine

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.