所请求的URL /about 在此服务器上未找到。

24 浏览
0 Comments

所请求的URL /about 在此服务器上未找到。

我的wordpress网站首页似乎显示正确,但是如果你点击任何其他页面,我会收到以下错误消息:

Not Found
The requested URL /about was not found on this server.
Apache/2 Server at www.wildlionmedia.co.uk Port 80

我不确定这是主题问题还是.htaccess文件没有被正确重写的问题。

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

有任何想法如何解决这个问题吗?

# 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

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]

# END WordPress

admin 更改状态以发布 2023年5月21日
0
0 Comments

那不是一个典型的WordPress重写模块.这是:

# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

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

我的.htaccess文件在哪里?WordPress的index.php和.htaccess文件应该在由“站点地址(URL)”设置在您的常规选项页面上指示的目录中。由于文件名以点号开头,因此在FTP客户端中可能无法看到该文件,除非您更改FTP工具的首选项以显示所有文件,包括隐藏文件。某些主机(例如Godaddy)可能不会显示或允许您编辑.htaccess,如果您通过Godaddy Hosting Connection安装WordPress。

创建和编辑(.htaccess)如果您还没有.htaccess文件,请创建一个。如果您具有shell或ssh访问服务器的权限,则可以使用简单的touch.htaccess命令创建文件。如果您正在使用FTP传输文件,请在本地计算机上创建一个文件,将其称为1.htaccess,将其上传到WordPress文件夹的根目录,然后将其重命名为.htaccess。

您可以通过FTP,shell或(可能)主机的控制面板编辑.htaccess文件。

最简单和最快的方法是在Dashboard >>设置>>永久链接中重置您的永久链接,并确保.htaccess可写,以便WordPress可以自己编写规则。

而且:您是否知道您正在将index.cgi作为您的默认文档而不是index.php进行调用?那是错误的。删除index.cgi。或尝试删除整行,因为在您的服务器上定义默认文档可能是不需要的。

0
0 Comments

如果以上所有方法都不起作用,那么尝试这个方法。我已经试过了,它对我有效。

  1. 打开 /etc/httpd/conf/httpd.conf
  2. AllowOverride None 改为 AllowOverride All
  3. 重新启动 apache 服务器。

更新 2017

对于新版本的 apache,文件名为 apache2.conf

因此,要访问该文件,输入 sudo nano /etc/apache2/apache2.conf,并在 块中更改相应的行。

0