0
我已在El Capitan OSX 10.11.2上安装rest-api 2.0beta9模块wordpress 4.4。Wordpress API在OSX上返回404(固定链接已启用)
我已经改变了/etc/apache2/httpd.conf
为我的用户的身份运行,以便它可以轻松地更新Sites
文件:
$ cat /etc/apache2/users/jtosey.conf
<Directory "/Users/jtosey/Sites/">
AddLanguage en .en
LanguagePriority en fr de
ForceLanguagePriority Fallback
Options Indexes MultiViews
# required for REST API:
AllowOverride All
Order allow,deny
Allow from localhost
Require all granted
</Directory>
我:
User jtosey
Group staff
我也是在用户的conf启用AllowOverride All
改变了我的固定链接,导致.htaccess
被创建:
$ cat /Users/jtosey/Sites/wordpress/.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~jtosey/wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~jtosey/wordpress/index.php [L]
</IfModule>
我可以很容易地卷曲主页:
$ curl http://localhost/~jtosey/wordpress/
<!DOCTYPE html>
<html lang="en-CA" class="no-js">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<script>(function(html){html.className = html.className.replace(/\bno-js\b/,'js')})(document.documentElement);</script>
<title>AAA – Car Culture</title>
但是我的API得到404:
$ curl http://localhost/~jtosey/wordpress/wp-json/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /~jtosey/wordpress/wp-json/ was not found on this server.</p>
</body></html>
任何想法?