Search code examples
wordpress.htaccessgoogle-cloud-platformhttp-status-code-404permalinks

How do I get access to my .htaccess files on Google Cloud for my Wordpress Website?


I migrated a website from one web host to another (which is Google Cloud), but I'm having problems changing my permalinks from plain to post name. I want to have the website show the name of the page on the url, but I can't figure out how to get access to my .htaccess files on Google Cloud to see if this is the cause of it.

The error on the website pages are 404 Not Found. But the pages are found if the permalinks are on plain and not on %postname%.

I'm working on a wordpress file.

I tried to change permalinks to %postname% in the wordpress dashboard, but I received an error. I also tried to see if plugins were an issue but its the permalinks needed to be on "plain" setting.


Solution

  • Access SSH: Go to edit your apache .conf

    sudo nano /etc/apache2/apache2.conf

    <Directory /var/www/>
            Options Indexes FollowSymLinks
            AllowOverride ALL <----(edit from none)
            Require all granted
    </Directory>
    

    Then restart apache2 using:

    sudo service apache2 restart