• Hello,

    I recently made an update to my site, I switched from using “plain” permalink structure to using “post name”, after running sudo a2enmod rewrite to enable that, and modifying /etc/apache2/apache2.conf to read:

    
    <Directory /var/www/wordpress>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    

    I have run into a problem where every page on my site loads perfectly at https://url.tld/post-name, except for the homepage, which is requiring me to enter it as https://url.tld/index.php, further research tells me this could be a problem with my .htaccess file, the config of which you can see below:

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    

    Any suggestions/guidance is greatly appreciated!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Check your Permalink settings: Go to Settings → Permalinks and make sure that “index.php” is not written in your custom structure.

    Thread Starter derian00

    (@derian00)

    index.php is not written in my custom structure

    You mentioned that you have this code:

    # 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

    already in your htaccess file. That would normally solve the issue you are having. I’d suggest looking at this article about mod_rewrite from digital ocean –https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite – and making sure you have enabled it correctly. Sometimes the server will need to be restarted before such changes take effect.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Removing “index.php” from Homepage URL’ is closed to new replies.