0

My wordpress site looks fine locally and when I deploy it on the GCP server, the home page is working fine but all other pages are giving 404 error. I tried shifting permalinks and updating the htaccess file. But the issue did not resolve. By using index.php in a custom url site is working but still form links are broken. Can anyone please help me to resolve the issue.

Hemanth Kumar
  • 2,728
  • 1
  • 4
  • 19
Udayavani
  • 306
  • 2
  • 9
  • You probably have a file/folder permission problem. Make sure that the Apache user owns the site's home folder, subfolders, and files. – John Hanley Jun 23 '23 at 02:34
  • I can access htaccess file from wordpress plugin and able to edit it.stil do i have file folder permission issue can u please elaborate – Udayavani Jun 23 '23 at 02:38
  • The answer is simple to figure out: who owns the files and what are their permissions? Add details like the OS and web server software. If these concepts are new, read a few tutorials on how to set up your web server. – John Hanley Jun 23 '23 at 02:43
  • So file should have read write access permissions? One more question is how can i can access website with index.php if i dont have proper permissions – Udayavani Jun 23 '23 at 02:49
  • Refer to this [SO](https://stackoverflow.com/questions/18352682/correct-file-permissions-for-wordpress) for file permissions and also Enable mod_rewrite by following this [SO](https://stackoverflow.com/a/34743649/19230181) by Jitendra Popat – Hemanth Kumar Jun 23 '23 at 13:49
  • Your post lacks details to answer correctly. The type of web server, the type of hosting, and the type of OS make a big difference. Your question is covered by numerous technical articles. Start with an official [guide](https://wordpress.org/documentation/article/changing-file-permissions/). – John Hanley Jun 23 '23 at 14:57

2 Answers2

2

WordPress 404 errors usually occur when you have removed certain pages from your website and haven’t redirected them to your live pages. Sometimes, these errors may also occur when you have changed a URL of a specific page.

Can you check and verify the points below :

  • Check permalink settings whether they are correctly configured with GCP/ In wordpress admin panel goto settings→permalinks and verify the desired structure is selected or not.
  • The recommended permissions for files are 644 and directories should have been set to 755.
  • Uninstall all the unwanted plugins; some plugins will conflict with themes.
  • You can use index.php to bypass 404 errors but it's not good as a long term solution.
  • As John Hanley suggested this might be also due to file permissions error. Can you check this doc for more information on file permissions
  • Enable mod_rewrite link shared in comments.
  • Refer to this Google Cloud Web hosting document.
Hemanth Kumar
  • 2,728
  • 1
  • 4
  • 19
0

What webserver are you using? For example if it's Apache, Add RewriteEngine On to your httpd.conf.

voldomazta
  • 1,300
  • 1
  • 10
  • 19