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.

Adding .xml as extension for XML templates does not work

August 29, 2010 8:43am

Subscribe [4]
  • #1 / Aug 29, 2010 8:43am

    Simon Balz

    34 posts

    Hi all,

    I have an own template group for my xml feeds.
    Therein I created a template with type XML and named it “test.xml”. When saving the template appears, I get double .xml extension: test.xml.xml. When I try to call the template via browser (http://mydomain.com/xml/test.xml or http://mydomain.com/xml/test.xml.xml) I get redirected to the group index template.
    When I rename the template just to “test”, the call via browser (http://mydomain.com/xml/test) does work but not if I add the “.xml” extension (http://mydomain.com/xml/test.xml).

    Is this a bug or is it just not supported?

    Thanks,
    Simon

  • #2 / Aug 30, 2010 3:55pm

    Ingmar

    29245 posts

    Therein I created a template with type XML and named it “test.xml”.

    What happens when you name it “test” and let EE add the suffix, as it were? What version and build are you using? Do you’ve got a link?

  • #3 / Aug 31, 2010 4:59am

    Simon Balz

    34 posts

    What happens when you name it “test” and let EE add the suffix, as it were?

    In this case, EE saves the template as “test.xml” on the filesystem, but it isn’t possible to call the template with http://mydomain.com/xml/test.xml, only with http://mydomain.com/xml/test.

    What version and build are you using?

    I’m on EE v2.1.0 Build 20100810.

    Do you’ve got a link?

    Unfortunately not, our development environment is not public.

  • #4 / Aug 31, 2010 3:58pm

    Ingmar

    29245 posts

    In this case, EE saves the template as “test.xml” on the filesystem, but it isn’t possible to call the template with http://mydomain.com/xml/test.xml, only with http://mydomain.com/xml/test.

    Naming it test.xml, on the other hand, works as intended but the file gets stored as test.xml.xml, is that correct? Why is that an issue if it works?

  • #5 / Dec 16, 2010 11:50pm

    Jon @ Kernel

    122 posts

    I’m also having this issue with EE2, but can’t get the xml file to display at all if an xml extension is added to the URL, regardless of naming (so xml.xml does not work either).  It displays fine without .xml in the URL. 

    Is there any solution to this?

  • #6 / Dec 17, 2010 11:41am

    Ingmar

    29245 posts

    Are you on the latest version and build? Are you using mod_rewrite? Can we rule out a server-side issue such as mod_security?

  • #7 / Dec 17, 2010 12:57pm

    Jon @ Kernel

    122 posts

    I was actually updating to 2.1.2 when you wrote that, as I can’t seem to prevent the throttling bug (#12346: where CSS template calls would count towards throttling checks) that 2.1.2 was said to fix.

    Unfortunately 2.1.2 doesn’t seem to have changed anything - throttling keeps cutting in unless I run a template with no stylesheet and image calls attached.  I think I might have to start a separate support request for that, though.

    On the XML issue - I’m running a local MAMP install with mod_rewrite - that may be the issue.  It’s a clean install with just a few pretty well supported addons installed.  I am using structure, though, which might be affecting this?  My current code is as follows:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      # Remove www
      RewriteCond %{HTTPS} !=on
      RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    
      # Remove index.php
      RewriteCond $1 !^(images|css|js|themes|uploads|favicon\.ico|robots\.txt|index\.php|system) [NC]
      RewriteRule ^(.*)$ /index.php?/$1 [L]
    </IfModule>
  • #8 / Dec 17, 2010 9:02pm

    Jon @ Kernel

    122 posts

    Thanks Ingmar - I’ve managed to work out what’s causing this.  Previously I was having 3 issues:

    1. Throttling cutting out access to the site after 3/4 quick page loads
    2. The issues accessing .xml files here
    3. All links that were clicked in the CP loading in the form http://my.site/?URL=http://expressionengine.com and displaying my index.php page

    All of these seem to be .htaccess related.  I have had this problem on a couple of installs (including one completely fresh install), all running on MAMP.

    The solution seems to be to move from the “Exclude” method for mod_rewrite, and to use the “File and Directory Check” method instead. 

    My current mod_rewrite (which works) is:

    RewriteEngine On
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    This has fixed all the issues I’ve been having (thankfully, since I’ve spent hours today trying to work out why my deployment environment was so buggy!), but it gives me the impression that this may be a more general bug that needs attention - will submit a bug report if you think it’s worth doing so.

  • #9 / Dec 19, 2010 1:28pm

    Greg Salt

    3988 posts

    Hi Vanquished,

    Thank you for the update. I don’t think there is anything in your report that can be described as a bug since they were all mod_rewrite related.

    @Simon,

    How are you getting on with this? Have you upgraded to version 2.1.2?

    Cheers

    Greg

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

ExpressionEngine News!

#eecms, #events, #releases