[wp-trac] [WordPress Trac] #39432: index.php/wp-json/ does not work

WordPress Trac noreply at wordpress.org
Mon Jan 2 22:31:41 UTC 2017


#39432: index.php/wp-json/ does not work
-------------------------------+------------------------------
 Reporter:  ccprog             |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  REST API           |     Version:  4.7
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+------------------------------

Comment (by ccprog):

 The public website has PHP 5.6.27, Apache/2.2.31 (Unix) with this
 .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
 }}}
 cgi-fcgi settings:
 {{{
 cgi.check_shebang_line  1       1
 cgi.discard_path        0       0
 cgi.fix_pathinfo        1       1
 cgi.force_redirect      0       0
 cgi.ignore_repeated_errors      1       1
 cgi.nph 0       0
 cgi.redirect_status_env no value        no value
 cgi.rfc2616_headers     0       0
 fastcgi.logging 1       1
 }}}
 Permalinks settings are "Month and name", Link header points to `/wp-
 json/`.

 My development system is a PHP 5.6.29-0+deb8u1, lighttpd/1.4.35, no
 equivalent to .htaccess.

 cgi-fcgi settings:
 {{{
 cgi.check_shebang_line  1       1
 cgi.discard_path        0       0
 cgi.fix_pathinfo        1       1
 cgi.force_redirect      1       1
 cgi.nph 0       0
 cgi.redirect_status_env no value        no value
 cgi.rfc2616_headers     0       0
 fastcgi.logging 1       1
 }}}
 Permalinks settings are "Post name", Link header points to `/index.php/wp-
 json/`.

 I am aware that `?rest_route=/` works, but that is not what the Link
 header and `rest_url('')` deliver, and therefore autodiscovery fails. For
 example in the [http://wordpress.org/plugins/rest-api-console/ REST API
 Console] plugin, the reference panel remains empty.

 The essence is, as I understand it now, there are setups where
 {{{
 $_SERVER[REQUEST_URI] = '/index.php/wp-json/'
 $_SERVER[PATH_INFO] = '/wp-json/'
 }}}
 The uri is then run through wp_rewrite, but PATH_INFO is not.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/39432#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list