Requests for missing .php files show apache 404, but missing non php files go to wordpress

I'm building a wordpress multisite in a sub-directory of my development machine that is seemingly working fine except that I can't use 'template_include' for urls ending in '.php'. So, any missed urls that don't seemingly point to a php file never hit wordpress and don't invoke my 'template_include' callback, so the user see a tradition non-wordpress apache 'Not Found' page. Other missed requests, if it doesn't look like a php file, get routed through wordpress and, if I don't handle it, show a standard worpress 404 style page.

This works as expected (displays home page)

http://mini.local/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php

This works as expected (dispays pretty wordpress-style 404 page and invokes my 'template_include' callback)

http://mini.local/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp <-- note the ending

This dies with apache level 404 (display apache based, wordpress is never invoked )

http://mini.local/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php  <-- note the ending

my .htaccess (I think this is standard)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On

RewriteBase /Sites/wordpress_stuff/ET-AppChase-004/
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
</IfModule>

# END WordPress

partial apache log for http://mini.local/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp (goes to wordpress 404 as expected)

[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^index\\.php$' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?wp-admin$' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace4] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-f' => not-matched
[rewrite:trace4] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-d' => not-matched
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(.*\\.php)$' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.notphp -> mysitetemplate/index2.notphp
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '.' to uri 'mysitetemplate/index2.notphp'
[rewrite:trace2] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] rewrite 'mysitetemplate/index2.notphp' -> 'index.php'
[rewrite:trace3] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add per-dir prefix: index.php -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index.php
[rewrite:trace2] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] trying to replace prefix /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/ with /Sites/wordpress_stuff/ET-AppChase-004/
[rewrite:trace5] [rid#1838458/initial] strip matching prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index.php -> index.php
[rewrite:trace4] [rid#1838458/initial] add subst prefix: index.php -> /Sites/wordpress_stuff/ET-AppChase-004/index.php
[rewrite:trace1] [rid#1838458/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] internal redirect with /Sites/wordpress_stuff/ET-AppChase-004/index.php [INTERNAL REDIRECT]
[rewrite:trace3] [rid#183eef0/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index.php -> index.php
[rewrite:trace3] [rid#183eef0/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^index\\.php$' to uri 'index.php'
[rewrite:trace1] [rid#183eef0/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] pass through

partial apache log for http://mini.local/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php (only shows apache 404 - never makes it to wordpress)

[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php -> mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^index\\.php$' to uri 'mysitetemplate/index2.php'
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php -> mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?wp-admin$' to uri 'mysitetemplate/index2.php'
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php -> mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^' to uri 'mysitetemplate/index2.php'
[rewrite:trace4] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-f' => not-matched
[rewrite:trace4] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-d' => not-matched
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php -> mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)' to uri 'mysitetemplate/index2.php'
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index2.php -> mysitetemplate/index2.php
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(.*\\.php)$' to uri 'mysitetemplate/index2.php'
[rewrite:trace2] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] rewrite 'mysitetemplate/index2.php' -> 'index2.php'
[rewrite:trace3] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add per-dir prefix: index2.php -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php
[rewrite:trace2] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] trying to replace prefix /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/ with /Sites/wordpress_stuff/ET-AppChase-004/
[rewrite:trace5] [rid#4002058/initial] strip matching prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace4] [rid#4002058/initial] add subst prefix: index2.php -> /Sites/wordpress_stuff/ET-AppChase-004/index2.php
[rewrite:trace1] [rid#4002058/initial] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] internal redirect with /Sites/wordpress_stuff/ET-AppChase-004/index2.php [INTERNAL REDIRECT]
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^index\\.php$' to uri 'index2.php'
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?wp-admin$' to uri 'index2.php'
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^' to uri 'index2.php'
[rewrite:trace4] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php' pattern='-f' => not-matched
[rewrite:trace4] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php' pattern='-d' => not-matched
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)' to uri 'index2.php'
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php -> index2.php
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(.*\\.php)$' to uri 'index2.php'
[rewrite:trace2] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] rewrite 'index2.php' -> 'index2.php'
[rewrite:trace3] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add per-dir prefix: index2.php -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php
[rewrite:trace1] [rid#400a5a8/initial/redir#1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] initial URL equal rewritten URL: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index2.php [IGNORING REWRITE]
  • Adam Czajczyk

    Hey @jjrohrer,

    I hope you're well today and thank you for your question!

    I'd suspect some errors on WP side if these .php template files would ever reach WP. As you say, if this is an Apache error there must be some kind of redirect issue.

    Have you tried to remove the full subdirectory path from your .htaccess file? Try please using this line

    RewriteBase /

    instead of this one

    RewriteBase /Sites/wordpress_stuff/ET-AppChase-004/

    and let me know if it worked!

    Cheers,
    Adam

  • jjrohrer

    Ok, using
    RewriteBase /
    doesn't even show a proper index.php, just apache 'Not Found' page. I see from the logs that is rewriting to '/index.php', but my install on this dev box isn't at the server root.

    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php -> mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^index\\.php$' to uri 'mysitetemplate/index.php'
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php -> mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?wp-admin$' to uri 'mysitetemplate/index.php'
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php -> mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^' to uri 'mysitetemplate/index.php'
    [rewrite:trace4] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-f' => not-matched
    [rewrite:trace4] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] RewriteCond: input='/Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate' pattern='-d' => not-matched
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php -> mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*)' to uri 'mysitetemplate/index.php'
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add path info postfix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] strip per-dir prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/mysitetemplate/index.php -> mysitetemplate/index.php
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] applying pattern '^([_0-9a-zA-Z-]+/)?(.*\\.php)$' to uri 'mysitetemplate/index.php'
    [rewrite:trace2] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] rewrite 'mysitetemplate/index.php' -> 'index.php'
    [rewrite:trace3] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] add per-dir prefix: index.php -> /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index.php
    [rewrite:trace2] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] trying to replace prefix /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/ with /
    [rewrite:trace5] strip matching prefix: /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/index.php -> index.php
    [rewrite:trace4] add subst prefix: index.php -> /index.php
    [rewrite:trace1] [perdir /Users/myname/Sites/wordpress_stuff/ET-AppChase-004/] internal redirect with /index.php [INTERNAL REDIRECT]

    I'm wondering if this has something to do with domain vs. sub-path install?

  • Adam Czajczyk

    Hey Jim!

    I think you may want to get back to your previous RewriteBase now but anyway it was well worth a try :slight_smile:

    I'm wondering if this has something to do with domain vs. sub-path install?

    Surely it may have something to do with "sub-path install" however the thing that bothers me the most here is that the error is on Apache level which means that Apache isn't capable of finding your file. What troubles me even more is that it can find any file but .php files in the same location.

    You've mentioned that you're building this on your development machine. I assume that this is your own server of some kind. May I know what setup do you use? Is it under Windows/iOS/Linux/etc and do you use any "server software bundle" (e.g. WAMP for Win)?

    Also, is there any chance that I could access your site and server directly?

    Please advise!

    Cheers,
    Adam

  • jjrohrer

    Thanks Adam - I can't open access since it's just my desktop.

    Same addition data points:
    Developing on Mac, intending to host on wpengine.
    I've been using AMPPS for my php/mysql stack.
    I just installed MAMPS, and encountered the same error.
    Verified both with a virgin Wordpress install.
    I noticed if I'm inside wp-admin, then URLs like blah/wp-admin/blah also returning the apache 404
    I'm getting the same results on my 2nd computer (laptop) that uses a more tradition apache and mysql direct install

  • jjrohrer

    Thanks to everyone that helped. I seem to have found a solution, even though I don't totally understand it. Basically, I modify my .htaccess file like so, replacing the two offending lines. I've linked to further references in the code. I hope this helps someone else.
    BTW - Tread lightly with this solution, don't trust it.

    # BEGIN Fix .php showing apache 404 instead of wordpress-based 404
    # On my dev boxes, not-found *.php files weren't getting redirected to wordpress.  I don't understand the logic,
    # but this seems to work.
    # I sought original help here: https://premium.wpmudev.org/forums/topic/requests-for-missing-php-files-show-apache-404-but-missing-non-php-files-go-to-wordpress#post-902489
    # Found the solution here...
    #http://wordpress.stackexchange.com/questions/85400/wordpress-multisite-htaccess/174303#174303
    #http://wordpress.stackexchange.com/questions/38937/500-error-when-using-virtual-host/73185#73185
    # Old (Wordpress 4.2.2 MU official version)
    #RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    #RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    # New
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    # END Fix .php showing apache 404 instead of wordpress-based 404

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.