The requested URL /about was not found on this ser

2020-02-16 06:42发布

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:

Not Found

The requested URL /about was not found on this server.

Apache/2 Server at www.wildlionmedia.co.uk Port 80

I'm not sure whether it's a problem with the theme or the .htaccess file that is not being rewritten correctly.

http://www.wildlionmedia.co.uk/

Any ideas how I can resolve the issue?

# Switch rewrite engine off in case this was installed under HostPay.
RewriteEngine On

SetEnv DEFAULT_PHP_VERSION 53

DirectoryIndex index.cgi index.php

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine Off
RewriteBase /wildlionmedia.co.uk/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wildlionmedia.co.uk/index.php [L]
</IfModule>

# END WordPress

17条回答
再贱就再见
2楼-- · 2020-02-16 06:56

If all above point not work. Then try this one. I tried it. It's working for me.

  1. Go /etc/httpd/conf/httpd.conf.
  2. Change the AllowOverride None to AllowOverride All.
  3. Restart the apache server.

UPDATE 2017

For new versions of apache the file is called apache2.conf

So to access the file, type sudo nano /etc/apache2/apache2.conf and change the correspondent line inside block <Directory /var/www >

查看更多
在下西门庆
3楼-- · 2020-02-16 06:56

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...

查看更多
祖国的老花朵
4楼-- · 2020-02-16 06:58

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
查看更多
仙女界的扛把子
5楼-- · 2020-02-16 07:01

The selected answer didn't solve this issue for me. So for those still scratching their head over this one, I found another solution!

In my Apache settings httpd.conf(you can find the conf file by running apachectl -V in your console), enabled the following module:

LoadModule rewrite_module modules/mod_rewrite.so

And now the site works as expected.

查看更多
▲ chillily
6楼-- · 2020-02-16 07:02

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.

查看更多
迷人小祖宗
7楼-- · 2020-02-16 07:03

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

查看更多
登录 后发表回答