这发生在我的本地机器Lubuntu 18.04上,带有apache2和Php 7.2.15。
尝试的步骤:
启用隐藏文件否。看到htaccess文件:
https://nimb.ws/4YJfDT
<切换permalink结构以尝试强制Wordpress创建新的。htaccess文件(如果缺少)。重新加载文件管理器无变化。
https://nimb.ws/eVkKb3
<运行终端命令
whereis .htaccess
列出了许多文件夹,但目标中没有一个文件夹(/var/www/html/wptest2/)。里面什么都没有
/var
以下内容:
owner@G700:~$ whereis .htaccess
: /usr/bin/. /usr/sbin/. /lib/x86_64-linux-gnu/. /usr/lib/x86_64-linux-gnu/.
/usr/lib/. /bin/. /sbin/. /etc/. /etc/.java /lib/. /lib64/. /usr/games/. /usr/local/bin/.
/usr/local/sbin/. /usr/local/etc/. /usr/local/lib/. /usr/local/games/. /usr/include/.
/usr/local/. /usr/libexec/. /usr/share/. /opt/emby-server/bin/.
/opt/dmmediaconverter/bin/. /opt/wine-stable/bin/. /opt/calibre/bin/.
/home/owner/.nvm/versions/node/v12.4.0/bin/. /home/owner/.local/bin/.
/snap/bin/. /usr/share/man/man4/. /usr/share/man/fi/. /usr/share/man/pl/.
/usr/share/man/id/. /usr/share/man/pt_BR/. /usr/share/man/man6/.
/usr/share/man/ja/. /usr/share/man/hr/. /usr/share/man/sv/.
/usr/share/man/hu/. /usr/share/man/man1/. /usr/share/man/fr.ISO8859-1/.
/usr/share/man/zh_CN/. /usr/share/man/man5/. /usr/share/man/zh_TW/.
/usr/share/man/man8/. /usr/share/man/ca/. /usr/share/man/man3/.
/usr/share/man/es/. /usr/share/man/nl/. /usr/share/man/da/.
/usr/share/man/it/. /usr/share/man/uk/. /usr/share/man/ko/.
/usr/share/man/fr.UTF-8/. /usr/share/man/sl/. /usr/share/man/man2/.
/usr/share/man/pt/. /usr/share/man/de/. /usr/share/man/de.UTF-8/.
/usr/share/man/cs/. /usr/share/man/sr/. /usr/share/man/man7/.
/usr/share/man/fr/. /usr/share/man/pl.UTF-8/. /usr/share/man/vi/.
/usr/share/man/ru/. /usr/share/man/tr/. /usr/share/info/. /usr/src/bcmwl-
6.30.223.271+bdcom/. /usr/src/linux-headers-4.15.0-58-
generic/.tmp_versions /usr/src/linux-headers-4.15.0-58-generic/.config
/usr/src/linux-headers-4.15.0-58-generic/. /usr/src/linux-headers-4.15.0-
58/. /usr/src/linux-headers-4.15.0-62-generic/.tmp_versions
/usr/src/linux-headers-4.15.0-62-generic/.config /usr/src/linux-headers-
4.15.0-62-generic/. /usr/src/linux-headers-4.15.0-62/.
你知道这是怎么回事吗?wordpress安装完全正常。我可以访问后端,创建帖子和页面,在前端导航,包括单击指向新页面的链接等。我已经在这方面开发了几个月的插件。但是。htaccess文件似乎不存在。
如果有人建议我只需手动创建。htaccess文件我接下来的问题是,如何验证wordpress是否使用它?我需要这个文件来输入JWT/restapi插件强制执行的一些规则。
Update
我添加了以下内容。htaccess文件代码,以访问新文件
/var/www/html/wptest2/
https://wordpress.org/support/article/htaccess/
iersn // meant to causing a breaking change. But doesn\'t
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
Wordpress没有从上面的行中断。
也就是说,我的安装总是在丑陋的链接上,因为漂亮的链接会导致找不到错误。我相信我没有正确的设置,我相信这一点。htaccess问题是一个原因。