The requested URL /about was not found on this server

前端 未结 20 1199
闹比i
闹比i 2020-12-23 00:05

The home page of my wordpress website seems to be displaying correctly but if you click through to any of the other pages I get the following error message:

         


        
相关标签:
20条回答
  • 2020-12-23 00:13

    That's not a typical Wordpress rewrite block. This is:

    # 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
    

    See http://codex.wordpress.org/Using_Permalinks#Where.27s_my_.htaccess_file.3F

    Where's my .htaccess file? WordPress's index.php and .htaccess files should be together in the directory indicated by the Site address (URL) setting on your General Options page. Since the name of the file begins with a dot, the file may not be visible through an FTP client unless you change the preferences of the FTP tool to show all files, including the hidden files. Some hosts (e.g. Godaddy) may not show or allow you to edit .htaccess if you install WordPress through the Godaddy Hosting Connection installation.

    Creating and editing (.htaccess) If you do not already have a .htaccess file, create one. If you have shell or ssh access to the server, a simple touch .htaccess command will create the file. If you are using FTP to transfer files, create a file on your local computer, call it 1.htaccess, upload it to the root of your WordPress folder, and then rename it to .htaccess.

    You can edit the .htaccess file by FTP, shell, or (possibly) your host's control panel.

    The easiest and fastest thing to do it reset your permalinks in Dashboard>>Settings>>Permalinks and make sure .htaccess is writable so WordPress can write the rules itself.

    And: are you aware you are calling index.cgi as your default document rather than index.php? That's wrong. Remove index.cgi. Or try removing the whole line, too, because defining a default doc on your server may not be needed.

    0 讨论(0)
  • 2020-12-23 00:13

    in setting > permalinks wordpress set simple and test again.

    0 讨论(0)
  • 2020-12-23 00:14

    It worked for me like this:

    Go to Wordpress Admin Dashboard > “Settings” > “Permalinks” > “Common settings”, set the radio button to “Custom Structure” and paste into the text box:

    /index.php/%year%/%monthnum%/%day%/%postname%/
    

    and click the Save button.

    0 讨论(0)
  • 2020-12-23 00:15

    FWIW: I rebuilt a LAMP server from scratch and installed WordPress. I had the same issue after saving my Permalink setting to generate the .htaccess file. Turns out that mod_rewrite was not enabled. I ran across this post on Digital Ocean.
    FTA:

    First, we need to activate mod_rewrite. It’s available but not enabled with a clean Apache 2 installation.

    $ sudo a2enmod rewrite
    

    This will activate the module or alert you that the module is already enabled. To put these changes into effect, restart Apache.

    $ sudo systemctl restart apache2
    
    0 讨论(0)
  • 2020-12-23 00:19

    I deleted the previous .htaccess file and created new one by clicking on save button in Settings->Permalinks

    and now that pages started working fine...

    0 讨论(0)
  • 2020-12-23 00:20

    Make sure mode_rewrite is enabled in APACHE settings. See link here https://github.com/h5bp/server-configs-apache/wiki/How-to-enable-Apache-modules

    Then make sure you have correct .htaccess https://wordpress.org/support/topic/404-errors-with-permalinks-set-to-postname/

    And correct virtual host settings in either Apache settings How to Set AllowOverride all

    0 讨论(0)
提交回复
热议问题