Wordpress 在此服务器上找不到请求的URL/about
我的wordpress网站的主页似乎显示正确,但如果您点击任何其他页面,我会收到以下错误消息:Wordpress 在此服务器上找不到请求的URL/about,wordpress,.htaccess,wordpress-theming,Wordpress,.htaccess,Wordpress Theming,我的wordpress网站的主页似乎显示正确,但如果您点击任何其他页面,我会收到以下错误消息: Not Found The requested URL /about was not found on this server. Apache/2 Server at www.wildlionmedia.co.uk Port 80 我不确定这是主题的问题还是未正确重写的.htaccess文件的问题 有没有办法解决这个问题 # Switch rewrite engine off in case
Not Found
The requested URL /about was not found on this server.
Apache/2 Server at www.wildlionmedia.co.uk Port 80
我不确定这是主题的问题还是未正确重写的.htaccess文件的问题
有没有办法解决这个问题
# 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
#如果在HostPay下安装了重写引擎,请关闭该引擎。
重新启动发动机
SetEnv默认值\u PHP\u版本53
DirectoryIndex.cgi index.php
#开始WordPress
发动机熄火
RewriteBase/wildlionmedia.co.uk/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/wildlionmedia.co.uk/index.php[L]
#结束WordPress
这不是典型的Wordpress重写块。这是:
# 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
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
看
我的.htaccess文件在哪里?WordPress的index.php和.htaccess文件
应在网站地址指示的目录中
(URL)在“常规选项”页面上的设置。因为文件名
以点开头,文件可能无法通过FTP客户端看到
除非更改FTP工具的首选项以显示所有文件,
包括隐藏的文件。某些主机(如Godaddy)可能不显示或
如果通过安装WordPress,则允许您编辑.htaccess
Godaddy主机连接安装
创建和编辑(.htaccess)(如果您还没有
.htaccess文件,创建一个。如果您有shell或ssh访问
服务器,一个简单的touch.htaccess命令将创建该文件。如果你
正在使用FTP传输文件,在本地计算机上创建文件,
将其命名为1.htaccess,将其上载到WordPress文件夹的根目录,
然后将其重命名为.htaccess
您可以通过FTP、shell或(可能)您的
主机的控制面板
最简单、最快的方法是在仪表板中重置永久链接>>设置>>永久链接并确保。htaccess是可写的,因此WordPress可以自己编写规则。
还有:您是否知道您正在调用
index.cgi
作为默认文档,而不是index.php
?那是错误的。删除index.cgi
。或者尝试删除整行,因为可能不需要在服务器上定义默认文档。Wordpress网站上有一个可信的答案:
我的.htaccess文件在哪里
WordPress的index.php和.htaccess文件应该在
由常规服务器上的站点地址(URL)设置指示的目录
选项页。由于文件名以点开头,因此
可能无法通过FTP客户端看到,除非您更改
FTP工具的首选项,以显示所有文件,包括隐藏文件
文件夹。某些主机(例如Godaddy)可能不显示或不允许您编辑
.htaccess,如果您通过Godaddy主机安装WordPress
连接安装
创建和编辑(.htaccess)
如果您还没有.htaccess文件,请创建一个。如果你有
shell或ssh访问服务器,一个简单的touch.htaccess命令
将创建该文件。如果您使用FTP传输文件,请创建一个
文件,称为1.htaccess,将其上载到根目录
,然后将其重命名为.htaccess
您可以通过FTP、shell或(可能)您的
主机的控制面板
以下permalink重写代码应包含在您的
.htaccess文件(自WordPress 3.0起):
#开始WordPress
重新启动发动机
重写基/
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则/index.php[L]
#结束WordPress
*摘自。我删除了以前的.htaccess文件,并通过单击设置->永久链接中的保存按钮创建了一个新文件
现在页面开始正常工作了…选择的答案并没有为我解决这个问题。所以对于那些还在为这件事挠头的人,我找到了另一个解决办法 在我的Apache设置中,启用了以下模块:
LoadModule rewrite\u module modules/mod\u rewrite.so
现在,该网站按预期运行。如果上述各点都不起作用。那就试试这个。我试过了。这对我有用
因此,要访问该文件,请键入sudo nano/etc/apache2/apache2.conf并更改块中相应的行
,我也遇到了同样的问题。可以访问我的主页,但在服务器上找不到这篇文章
转到cpanel文件管理器>public\u html
并删除.htaccess
然后转到WordPress中的permalink设置,将permalink设置为您想要的,然后保存。维奥拉一切恢复正常
这个问题发生在我更新WordPress之后。它对我来说是这样的: 转到Wordpress管理仪表板>“设置”>“永久链接”>“常用设置”,将单选按钮设置为“自定义结构”,并粘贴到文本框中:
/index.php/%year%/%monthnum%/%day%/%postname%/
/index.php/%year%/%monthnum%/%day%/%postname%/
然后单击保存按钮
我从这个中得到了这个解决方案,它对我来说是这样的: 转到Wordpress管理仪表板>“设置”>“永久链接”>“常用设置”,se
/index.php/%year%/%monthnum%/%day%/%postname%/
# 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
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
<Directory "path/to/dir">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
Order allow,deny
Allow from all
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [END]
RewriteCond $1 ^(index\.php)?$ [OR]
RewriteCond $1 \.(gif|jpg|png|ico|css|js)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ - [END]
RewriteRule ^ /index.php [L]
</IfModule>
# END WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond $1 ^(index\.php)?$ [OR]
RewriteCond $1 \.(gif|jpg|png|ico|css|js)$ [NC,OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ - [END] not as in Github [S=1]
RewriteRule ^ /index.php [L]
$ sudo a2enmod rewrite
$ sudo systemctl restart apache2
<Directory “/var/www/html”>
<Directory />
AllowOverride none