skip to Main Content

I’ve just signed up for hosting on hostinger.com …

I have copied all my WordPress files to the root of the site …
installed the database and set up the wp-config file …
installed the SSL certificate …

The home page of the site works, but when I click on one of the links, the site returns a 404 error.

I’ve tried to change the permalinks, but I can’t access the administration interface. (error 404)

Does anyone have any idea how I can solve this problem?

Thank you in advance.

I suppose others have had the same problem.
I’m waiting for some ideas on how to solve this problem

2

Answers


  1. First make sure you have the backup of the WordPress files structure and the database. Then use the following steps to debug the problem:

    1. .htaccess:

    Ensure you have an .htaccess file in the root of your WordPress installation and that it has the right permissions (typically 644). The default .htaccess for WordPress should look something like this:

    # 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
    

    If the .htaccess file is missing, create one with the above content.

    1. Mod_Rewrite Module:

    Ensure that the mod_rewrite module is enabled on your server. This module is necessary for the custom permalinks in WordPress to work. Since you’re using Hostinger, they likely have it enabled, but it’s worth checking with their support just in case.

    1. Update Permalinks:

    Even though you can’t access the administration interface, you can try resetting the permalinks using the database:

    • Login to your database (probably through phpMyAdmin on Hostinger).
    • Navigate to the wp_options table.
    • Look for the option_name called ‘permalink_structure’ and change its option_value to the default (i.e., empty it).
    • After this, try accessing the admin interface and reset the permalinks to your desired structure.
    1. Debugging:

    Enable debugging in WordPress to see if there are any specific errors.

    Edit your wp-config.php and set:

    define('WP_DEBUG', true);
    

    Visit your site and see if any error messages or warnings are displayed.

    1. Database URL References:

    If your domain name has changed or if there’s a difference in the folder structure, there might be references to the old URL in the database. You can use plugins like "Better Search Replace" to replace old URLs with the new one, but since you can’t access the admin panel, you might have to manually check the database or use SQL queries to update URLs.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search