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.

Upgraded, {stylesheet=} not working

July 26, 2008 9:07am

Subscribe [2]
  • #1 / Jul 26, 2008 9:07am

    wolferey

    33 posts

    I had some time yesterday so I decided I’d finally upgrade from 1.63 to 1.64, since I had put it off for a while. I followed the guide for updating (http://expressionengine.com/docs/installation/update.html), and ran update.php, everything going fine.

    I cleared cache, and updated my page, and suddenly I found my page without style.. so I checked around, and noticed I couldn’t access my css-script through the url for stylesheet. I tried changing stylesheet to path, and it worked. To see it in action, you can visit my testsite:


    My testsite:
    http://www.spillmodding.no/site/

    Code:

    <link rel="stylesheet" href="{stylesheet={template_group}/frontpage_screen}" type="text/css" media="screen, projection" />

    Url:
    http://www.spillmodding.no/?css=site/frontpage_screen.v.1216527753

     

    The strange part is I can access it fine using index.php in the url:
    http://www.spillmodding.no/index.php?css=site/frontpage_screen.v.1216527753

    So I am guessing it’s an .htaccess problem, which is still kinda wierd since it worked before the upgrade O,o..


    .htaccess code:

    # BEGIN ExpressionEngine
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond $1 ^(weblog|404|member|spillmodding|slideshowpro|wiki|search|site|forum|P[0-9]{2,8}) [NC]
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php\?/$1 [L,QSA]
    </IfModule>
    # END ExpressionEngine
  • #2 / Jul 26, 2008 11:15am

    Derek Jones

    7561 posts

    I do not see how the upgrade would have affected this, since the URL output by the stylesheet tag is identical.  The issue is that your rewrite rules are not allowing for a query string by itself.

    http://spillmodding.no/?ACT=10

    Behaves the same, it’s redirecting, not even rewriting, to /index.php

  • #3 / Jul 26, 2008 11:29am

    wolferey

    33 posts

    Yeah, that’s why I was guessing it was a htaccess problem, since putting index.php allowed me to see the stylesheet.. it’s still so very wierd it worked before O,o.. Guess it’s one of em mysteries.

    Any idea on how to change the htaccess to make it work?

  • #4 / Jul 26, 2008 11:37am

    Derek Jones

    7561 posts

    I would add

    index\.php

    To your list of exclusions, since the server’s going to go to that directly with a URL containing only a query string, if it’s set properly as a directory index.

  • #5 / Jul 26, 2008 12:24pm

    wolferey

    33 posts

    Didn’t work, I can’t access my site at all if I add that to my list..
    But I got to wonder, I don’t have a list of excludes, I got a list of includes.

    To break it down:

    RewriteEngine On   <—This one is obvious


    RewriteBase /  <—Not quite sure if its needed, but I have seen many examples having it so I did too.


    RewriteCond $1 ^(weblog|404|member|spillmodding|slideshowpro|wiki|search|site|forum|P[0-9]{2,8}) [NC]  <—My list of includes.. Tried adding index\.php in there, but that messed up everything for me, got an internal server error then.


    RewriteCond %{REQUEST_FILENAME} !-d   <—check if the request is for a real directory (one that exists on the server), if it is, then index.php won’t be served.


    RewriteRule ^(.*)$ /index.php\?/$1 [L,QSA]  <—- Rewrite the url if rewritecond is met, so if someone typed in “http://www.spillmodding.no/forum/” they would see the forum, while the real url is actually “http://www.spillmodding.no/index.php?/forum/”..


    Im not sure why, but I had to include a ? after index.php to access the pages, or else it would just take me to the index page.. http://www.spillmodding.no/index.php/forum/ wouldn’t work at all.


    In the admin panel I had to set “Name of your site’s index page” to nothing (blank) and I have set “Force URL query strings” to no.

  • #6 / Jul 26, 2008 12:44pm

    Derek Jones

    7561 posts

    Ah, sorry, I just glanced at it quickly and thought you were excluding, didn’t notice that there was no bracket in front of the carrot.

    RewriteCond %{REQUEST_FILENAME} !-d

    Why do you have this if you have an explicit include list?

    Im not sure why, but I had to include a ? after index.php to access the pages, or else it would just take me to the index page.. http://www.spillmodding.no/index.php/forum/ wouldn’t work at all.

    Your server does not appear to support the path_info server variable.  Details

    But using Firebug it looks like this content is being served first on those requests:

    <html>
    
    <head>
    
    <title>Redirect</title>
    
    <meta http-equiv="refresh" content="0; url=index.php">
    
    </head>
    
    <body bgcolor="#ffffff">
    
    </body>
    
    </html>

    Which is, incidentally, exactly what I get if I navigate to http://spillmodding.no/index.html.  That tells me the directory index order is incorrect, and it’s trying to send that file-less request with a query string to index.html instead of index.php.  Do you have an index.html file in your root directory?

  • #7 / Jul 26, 2008 12:50pm

    wolferey

    33 posts

    actually, yes, there is an index.html file there :o   Should I just delete it?
    And I’ll ask my webhost about the path_info server variable

  • #8 / Jul 26, 2008 12:54pm

    Derek Jones

    7561 posts

    Well it’s not necessary for sure, nor part of ExpressionEngine, and if you have requests come in for the file, you can use mod_rewrite to give them a proper permanent redirect.  It might also be good to have them configure (or via .htaccess if they allow it) the directory index to give index.php priority over all other directory index files.

    DirectoryIndex index.php index.shtml index.html index.htm

    Here are the docs on the AcceptPathInfo Apache directive, which is linked from that KB article, too.

  • #9 / Jul 26, 2008 1:01pm

    wolferey

    33 posts

    Deleted it now, and it seems to have fixed up the issue, style is loading properly with {stylesheet=} now ;o)
    Darn pesky index.html’s sneakin in when they shouldn’t, must have been a sleepy upload error from my side somehow :red:

    Thanks for all the help, and I’ll be asking my webhost about the path_info and directoryindex 😊

  • #10 / Jul 26, 2008 1:23pm

    Derek Jones

    7561 posts

    Sounds great, wolferey.  I’ll mark this as resolved, but if you have a followup question on one of the other issues, go ahead and use the button above the thread to start a new related support topic so the support agent helping you can still have the context.

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

ExpressionEngine News!

#eecms, #events, #releases