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.

HTAccess woes - removing index.php breaks css links?

May 12, 2009 8:40am

Subscribe [2]
  • #1 / May 12, 2009 8:40am

    Moviestorm

    79 posts

    This is a complete mystery to me, because the whole thing was working fine on our test servers, but moving them over to live servers has broken virtually all kinds of things.

    We have domains running on an Apache server using Despatcher to create some reverse lookups to rewrite various urls (such as /forums, etc). This may or may not be a part of the problem.

    I have an HTAccess file thusly:

    RewriteEngine On
    RewriteCond $1 ^(moviestorm|search|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    I’ve updated and double checked my path settings everywhere, including each section of the site and the general configuration. When I access a page that has the following:

    <link rel='stylesheet' type='text/css' media='all' href='{stylesheet=moviestorm/ms_css}' />
    <style type='text/css' media='screen'>@import "{stylesheet=moviestorm/ms_css}";</style>

    The page doesn’t recognise the css but I get this in the source:

    <link rel='stylesheet' type='text/css' media='all' href='http://www.moviestorm.co.uk/?css=moviestorm/moviestorm_css.v.1242123501' />
    <style type='text/css' media='screen'>@import "http://www.moviestorm.co.uk/?css=moviestorm/moviestorm_css.v.1242123501";</style>

    If I hardcode and use a regular text css file like this:

    <link rel='stylesheet' type='text/css' media='all' href='http://www.moviestorm.co.uk/moviestorm_css.css' />
    <style type='text/css' media='screen'>@import "http://www.moviestorm.co.uk/moviestorm_css.css";</style>

    The page also ignores the css.

    If I rename the hard-coded css files to ms_css.css it works, but if I do this:

    <link rel='stylesheet' type='text/css' media='all' href='{stylesheet=moviestorm/ms_css}' />
    <style type='text/css' media='screen'>@import "{stylesheet=moviestorm/ms_css}";</style>

    Again, the page doesn’t recognise the css file.

    I’m notcounting on anyone being able to figure this out, because there are quite a lot of server variables I don’t really have any control over, but if anyone has ever seen this before, I’d appreciate any ideas. I don’t want to hardcode all the templates, if I can help it.

  • #2 / May 12, 2009 12:58pm

    Joe Michaud

    154 posts

    Hi Moviestorm,

    I can’t see the problem from the code you’ve posted…  Though I do see an irregularity:

    You are requesting the stylesheet “ms_css” from the group “moviestorm” but receive “moviestorm_css” from the group “moviestorm”.  Perhaps this is just a cut and paste error?

    As you can see, the {stylesheet} variable in EE does some special things and may be a bit tough on your debugging efforts.  You might try replacing it with {path=moviestorm/ms_css} to see what you get.

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

ExpressionEngine News!

#eecms, #events, #releases