Referencing External Style Sheet

I changed a folder to a sub-domain: it went from www.example.com/app to app.example.com

I was using some ASP includes as well
<!--#INCLUDE FILE="../../../includes/header.html" -->

Open in new window

All the ASP includes work.
The style sheet and JavaScript are not found
<link href="../../../includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../../../includes/external_window.js"></script>

Open in new window

Is there another way to do this or do I need to use an absolute path?

Here is the link http://android-apps.coreybryant.com/spbsoftware/spbsoft-shell-3d if that helps.
LVL 29
coreybryantAsked:
Who is Participating?
 
remorinaCommented:
The subfolder android-apps changed to a sub domain, the folder can also be accessed through http://coreybryant.com/android-apps/spbsoftware/spbsoft-shell-3d/ which would work correctly.

I can see your CSS and JS files at

http://coreybryant.com/includes/style.css
and
http://coreybryant.com/includes/external_window.js

The problem is that now the files are out of the scope of the subdomain, so relative paths would not work, so you need to either link to them using absolute domain paths such as below

<link href="http://coreybryant.com/includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://coreybryant.com/includes/external_window.js"></script>

Open in new window


Or copy the includes folder under the android-apps folder so you can access it by relative paths using

<link href="/includes/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/includes/external_window.js"></script>

Open in new window

0
 
coreybryantAuthor Commented:
Thanks, I thought I would have to do that.  I just never ran into the issue with the ASP includes (that are in the same folder as the JS / CSS) would work and the CSS / JS would not (usually it was the other way around).
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.