• Resolved shadowshiftcom

    (@shadowshiftcom)


    On my WordPress MultiSite I had the standard suggested .htaccess in root directory for subdomains setup:

    RewiteEngine On
    RewriteBase /
    RewriteRule ^index.php$ - [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*.php)$ $1 [L]
    RewriteRule . index.php [L]

    This was causing due to domain/site changes or who knows what a 500 Internal Server Error in the browser and the following in error_log:

    [Fri Jun 13 06:53:47 2014] [error] [client 192.168.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3072): [client 192.168.0.1] r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php
    [Fri Jun 13 06:53:47 2014] [debug] core.c(3078): [client 192.168.0.1] redirected from r->uri = /shadowforum/non-existent.php

    The only thing I could figure out so far is to comment this line:

    # RewriteRule ^(.*\.php)$ $1 [L]

    All seems to be fine but what should this line be doing, am I losing any functionality or is there a better solution?

    Thanks in advance!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hi, you may check out the general settings for sub-domains.

    Thread Starter shadowshiftcom

    (@shadowshiftcom)

    Hi, what settings?

    Just to be clearer, it is with any non-existent php file base domain, subdomains and mapped domains. This is what I would expect to happen:

    https://www.ads-software.com/support/forum/non-existent.php

    This is what happens with recommended .htaccess:

    https://dev.hashbang.xyz/support/forum/non-existent.php

    This is what happens with line commented out # RewriteRule ^(.*\.php)$ $1 [L]

    https://hashbang.xyz/support/forum/non-existent.php

    Not really sure why the php files need a RewriteRule? Or what the disadvantage of commenting it out would be. Seems like it must be there for some reason ??

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    I have no idea where you got this line in the first place:

    RewriteRule ^(.*.php)$ $1 [L]

    Go to WP Admin -> Network -> Settings -> Network Setup

    Copy that .htaccess and use it.

    Thread Starter shadowshiftcom

    (@shadowshiftcom)

    # RewriteRule ^(.*\.php)$ $1 [L]

    That is were I got it. Somehow I missed a \ in the line above in my original posts here but the \ is in my .htaccess, here is where I got it:

    https://hashbang.xyz/wp-content/uploads/2014/06/settings.png

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    *re-reads something* Oh… kay. That IS right. Wow. How did I never notice? Well. Okay now I’m confused.

    redirected from r->uri = /shadowforum/non-existent.php

    Is that folder a separate forum you installed?

    Thread Starter shadowshiftcom

    (@shadowshiftcom)

    Thanks Mika, I really appreciate your views on this ??

    It does not exist, its just an example of something that does not exist. Its not the most important thing in the world for sure ?? I have been ignoring it a long time but for any never existing, non existing or previously existing but no longer existing .php file it just seems like the stock .htaccess does not handle it elegantly as it does for other file types or as I would imagine designed. Or I’m being blind, missing a dot or a t cross somewhere…

    Mostly it became more of a focus of my error_log obsession when I switched the primary domain from shadowshift.com to hashbang.xyz and more search engine links were incorrect, going to generic error pages, not pointing back to a screen users could just click on home or whatever to start again… Both my 3.9.1 MultiSites and my one 4.0 Alpha MultiSite exhibit this behavior.

    I haven’t really taken the time yet to understand the RewriteRule programming and I haven’t noticed ill effects of commenting the line out (yet!) so I’m hoping someone can point me in right direction first.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Well it’s sort of an “Anything that ends in .php goes to the page name” rule, so if you went to /foo.php and that page DID NOT exist as a file on the server, it would redirect to /foo

    If the real file is there, it would always defer to that. It shouldn’t be an issue, since you don’t want to ever end WP URLs in .php anyway.

    Thread Starter shadowshiftcom

    (@shadowshiftcom)

    Mika, Ok works for me, I’ll just stop worrying about what nonsense search engine robots come up with… Thanks! You Rock!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘.htaccess question’ is closed to new replies.