htamayo Posted July 23, 2008 Share Posted July 23, 2008 Hi, I coded a website with html+php+mysql+apache2, everything works fine except that the css doesn't display, particulary the images and some other css classes, so, I tried to modify my apache2.conf adding this line: AddType text/css .css But still doesn't work Also, googling, I found that I can put this line in a .htaccess but still doesn't work. My question is: how can I enable apache2 to display correctly my css file? Regards Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/ Share on other sites More sharing options...
wildteen88 Posted July 23, 2008 Share Posted July 23, 2008 css files aren't handled by Apache. Apache will only serve the css file to the web browser, which will apply the CSS defined to your page. Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-597883 Share on other sites More sharing options...
htamayo Posted July 23, 2008 Author Share Posted July 23, 2008 It's weird, because if I type in my browser: /var/www/app/viewitem.html I can view all css rules. But, If I type: http://localhost/viewitem.html Almost all css rules disappear, that's because i think that the problem is Apache. The browser I'm using is Firefox. So, I think apache is involved in how the css is displayed Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-597964 Share on other sites More sharing options...
wildteen88 Posted July 23, 2008 Share Posted July 23, 2008 How are you attaching your stylesheet? Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-598029 Share on other sites More sharing options...
secoxxx Posted July 23, 2008 Share Posted July 23, 2008 yes, please post the method in which you are attaching or importing the css file. Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-598033 Share on other sites More sharing options...
htamayo Posted July 24, 2008 Author Share Posted July 24, 2008 You're not gonna believe the answer... it was about file permission. The "not showed files" had "rwx----" file permission, I changed to 0644 file permission and ...everything works. Wow, that really makes me like an idiot , i checked the php code, css, apache conf and was a file permission issue, but, you know, I have a lot of to learn about LAMPs, Linux is a great OS, in fact, as a coder, i never pay attention like that but it really a mistake. Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-599045 Share on other sites More sharing options...
secoxxx Posted July 25, 2008 Share Posted July 25, 2008 we all look past the small things every once and a while Quote Link to comment https://forums.phpfreaks.com/topic/116261-solved-display-correctly-css-files-in-apache2/#findComment-599082 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.