LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-22-2009, 01:13 PM   #1
Azul Rondo
Member
 
Registered: Jun 2009
Distribution: Ubuntu 12.04
Posts: 32

Rep: Reputation: 15
Apache css path problems


Hello all,
I am teaching myself php and web programming using Apache on a Fedora home box.

The problem may be with css, but I just can't get css to follow absolute paths:

This doesn't work
PHP Code:
@import url('/var/www/html/css/index.css'
This does
PHP Code:
@import "../css/index.css"

as long as the calling file is only one sub-directory deep. I have had no success with calling files that are nested two directories down.

Any advice or suggestions would be appreciated.

Rondo
 
Old 12-22-2009, 02:06 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Well this couldn't be relevant to CSS at all, that's what's in the file, not the file itself. Certainly you'd NEVER want to use absolute paths. Horrific. I'd be looking at the Directory definitions to ensure that you're allowed to access files in that location, and of course check your error logs for issues there.
 
Old 12-22-2009, 06:35 PM   #3
Azul Rondo
Member
 
Registered: Jun 2009
Distribution: Ubuntu 12.04
Posts: 32

Original Poster
Rep: Reputation: 15
css path

Quote:
Originally Posted by acid_kewpie View Post
Well this couldn't be relevant to CSS at all, that's what's in the file, not the file itself. Certainly you'd NEVER want to use absolute paths. Horrific. I'd be looking at the Directory definitions to ensure that you're allowed to access files in that location, and of course check your error logs for issues there.
Thanks acid_kewpie, the call I'm using actually looks like this
PHP Code:
$css = $_SERVER["DOCUMENT_ROOT"] . "css";
@import url('<?php print($css);?>/index.css');
This is what the browser sees.
PHP Code:
@import url('/var/www/html/css/index.css'); 
Just to verfy that it was the path and not the syntax that failed, I've typed in the absolute path.

If I weren't allowed access wouldn't the relative path call fail as well?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
apache css access denied sycamorex Linux - Server 2 04-02-2008 01:08 PM
Apache parsing css files for php scripting. dickohead Programming 1 09-14-2006 04:40 AM
Apache path and kde path questions darkraider Debian 1 11-12-2005 05:07 AM
what browser for apache css rendering? rblampain Linux - Software 4 09-18-2005 10:41 AM
Add CSS to Apache Autoindexes? dbc001 Linux - Networking 0 12-11-2004 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration