SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS broke -- localhost vs remote host -- after upload

    This is really strange. The site I'm working on is hosted on my localhost testing server and looks the same on Mac/Safari and F11/Firefox 3.5. This is Apache/PHP/MySQL. And Mac/Safari and XP/IE6 look good with MAMP Server.

    Then, mI uploaded the site to a godaddy host account and the CSS is all broken in F11/Firefox 3.5 but reasonably in tact with XP/IE6. I use two include files, one each for the URL/server path variables and MySQL database connections. I've rechecked these files and they're ok. (besides IE wouldn't work if they were not correct).

    What could be going on here? I'm not even sure what to search for since this is very odd to me-- a (mostly) valid HTML, and 100 percent valid CSS site isn't displayed the same on localhost and remote servers.

    X
    Dinopad R40 - F15/XP
    APACHE 2
    MYSQL 5
    PHP 5

  2. #2
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    8,897
    Mentioned
    138 Post(s)
    Tagged
    2 Thread(s)
    Are you saying you're using PHP to serve CSS files?
    If you are, you should add
    PHP Code:
    header('Content-Type: text/css'); 
    to the top of the PHP file
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  3. #3
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SXTX, There are two include files containing site variables and the connection to the database. These are the only changes necessary to move the site from one server to another. There is no reason for the site to be broken unless there is something different about my AMP server then the godaddy server.

    And the CSS is linked using,
    Code CSS:
    <link href="../_css/default_site.css" type="text/css" rel="stylesheet" media="screen" />
    X
    Dinopad R40 - F15/XP
    APACHE 2
    MYSQL 5
    PHP 5

  4. #4
    SitePoint Addict
    Join Date
    Jan 2002
    Location
    Southwest Florida
    Posts
    393
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xtiansimon View Post
    the CSS is linked using,
    Code CSS:
    <link href="../_css/default_site.css" type="text/css" rel="stylesheet" media="screen" />
    X
    Could be GoDaddy doesn't like the underscore in _css.

    Or, if the link is from the root of the site, that suggests the css file is found a level above the site root, and that could definitely be problematic. From your main index page, the link should look something like
    <link href="_css/default_site.css" type="text/css" rel="stylesheet" media="screen" />
    or
    <link href="/_css/default_site.css" type="text/css" rel="stylesheet" media="screen" />

    Notice there's no leading ".." in those links.

  5. #5
    SitePoint Zealot
    Join Date
    Oct 2009
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the reply. I figured out the trouble. I was testing the advise of another forum and altered the dothtaccess file with this line:

    addtype application/x-httpd-php .css

    It was supposed to modify the httpd.conf to facilitate the execution of php in css files. Once this line was removed, linked css started working again.
    Dinopad R40 - F15/XP
    APACHE 2
    MYSQL 5
    PHP 5


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •