![权限 Mysql Ubuntu 18.04](https://linux22.com/image/905463/%E6%9D%83%E9%99%90%20Mysql%20Ubuntu%2018.04.png)
我遇到了一个问题。我在我的 ubuntu 18.04.1 lamp server + phpmyadmin 上安装。并运行现有站点(本地)。主页运行良好。但所有其他页面都返回 404。我从 windows(Openserver)、文件和数据库获取此站点。数据来自 apache error_log
27.0.0.1 - - [06/Oct/2018:17:24:43 +0300] "GET / HTTP/1.1" 200 11017 "http://cencal.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
127.0.0.1 - - [06/Oct/2018:17:24:45 +0300] "GET /tasks/20171005task197brstj/ HTTP/1.1" 404 517 "http://cencal.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
127.0.0.1 - - [06/Oct/2018:17:25:26 +0300] "GET /tasks/20171005task197brstj/ HTTP/1.1" 404 518 "http://cencal.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
127.0.0.1 - - [06/Oct/2018:17:25:27 +0300] "GET /tasks/20171005task197brstj/ HTTP/1.1" 404 517 "http://cencal.loc/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36"
我的网站基于 /home/user/serv/sitename,我使用 wordpress 来管理该网站,并更新 peralinks
答案1
确保.htaccess
在您的网站的文档根目录中创建包含以下内容的文件:
# 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
.htaccess
另外,检查Apache 配置是否允许使用文件。