ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Allow PHP only working in full path

September 29, 2010 12:07am

Subscribe [2]
  • #1 / Sep 29, 2010 12:07am

    adam.weinstock

    7 posts

    Lets say I have a template group named “group” and a template named “index”.  I’m finding that if I allow PHP in the “index” template it only parses PHP when I access mysite.com/group/index and does not parse PHP when I access mysite.com/group.

    Any help?

  • #2 / Sep 29, 2010 3:06pm

    Ingmar

    29245 posts

    What version and build of EE are you using? Any extensions? If the same template is accessed, EE’s settings re: PHP should be the same. Are you using mod_rewrite or some other server side rewrites? What about mod_security?

  • #3 / Sep 29, 2010 4:00pm

    adam.weinstock

    7 posts

    v1.6.9

    Only 3rd party add-ons are jQuery for the Control Panel extension v1.1.1 and Solspace Freeform module v3.0.1

    Web server is nginx with basic rewrite rule to remove index.php.

    location / {
        index index.php;
    
        if (-e $request_filename) {
            break;
        }
    
        if (!-e $request_filename) {
            rewrite ^(.*)$ /index.php?$1 last;
            break;
        }
    }

    Again, visiting http://www.mysite.com/group will NOT parse PHP, but visiting http://www.mysite.com/group/index will.  Both requests are being rewritten via the rule above because the pages render, but PHP only appears when the full group/template path is provided in the URL.  Strange.

  • #4 / Sep 29, 2010 4:15pm

    adam.weinstock

    7 posts

    Just to clarify further, visiting http://www.mysite.com/group results in the PHP being stripped from the template.  In other words, EE may be stripping the PHP tags before it even gets to the parsing stage.

    Via EE debugging I can confirm that “Parsing PHP on Output” does not occur when visiting http://www.mysite.com/group.

    Additionally, I can confirm that the nginx rewrite rule above doesn’t cause the same issue in EE v2.x, so I’m assuming the bug is inherent to v1.6.9.

  • #5 / Sep 29, 2010 4:55pm

    adam.weinstock

    7 posts

    OK ... I’ve resolved this issue, but it seems to have exposed a bug.  I had SQL query caching enabled, and EE was accessing an old query to display the information.  Even after deleting all cache via the cp this continued to occur, so I manually deleted the cache and everything is working now.

  • #6 / Sep 29, 2010 5:00pm

    Ingmar

    29245 posts

    Ah, a caching issue, that makes sense… glad to see you were able to get to the bottom of this. Post again as needed, please.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases