Website help

Tai

HEAD CAPTAIN
Staff member
Administrator
May 11, 2003
14,279
2
2,645
515
United Kingdom
Need help as I've hit a mental block...

I'm trying to add some pages to my website in subfolders; i.e. site.com/services/page1.html

But I can't get it to look at my CSS properly

At the top I have this

Code:
    <link rel="stylesheet" type="text/css" href="3dParty/bootstrap/css/bootstrap.min.css"/>    
    <link rel="stylesheet" type="text/css" href="css/global.css"/>
    
    <link rel="stylesheet" type="text/css" href="css/typo.css"/>
    
    <link rel="stylesheet" type="text/css" href="3dParty/colorbox/colorbox.css"/>
    
    <link rel="stylesheet" type="text/css" href="css/social.css"/>

I've tried pointing it to the direct url i.e. http://mysite.com/css/global.css etc but it isn't actually changing
 

Jacko

Dedicated Member
Dedicated Member
Jul 7, 2011
946
10
104
the netherlands
<link rel="stylesheet" type="text/css" href="http://mysite.com/css/global.css"/>
if tht doesn't work pm me a link of the website an ill pm a fix back
 
Last edited:

Ardbeg

Legend
Legendary
Aug 8, 2004
3,211
1
144
260
Southern England
Use the same idea as a Mir namelist. ie. the dots for going back a level.
href="../css/global.css" rel="stylesheet" type="text/css"
 

Tai

HEAD CAPTAIN
Staff member
Administrator
May 11, 2003
14,279
2
2,645
515
United Kingdom
Use the same idea as a Mir namelist. ie. the dots for going back a level.
href="../css/global.css" rel="stylesheet" type="text/css"

I did know this but couldn't get it to work in Dreamweaver. It kept changing itself to the local path of the files i.e. ../../../../../Documents/MyWebsite/CSS/global.php or some **** like that
and I'm using DW Templates to keep all my pages up to date hence why I was looking for an alternative method.

TY though
 

Ardbeg

Legend
Legendary
Aug 8, 2004
3,211
1
144
260
Southern England
I always have DW sites set to have links relative to site root. This is done via the Site definition/Local Info/Advanced tab.
The local root folder can be anything like you said but end at the equivalent of the domain name. ../../../../../Documents/MyWebsite/ some might use public_html like mine so the root is this D:\www.blah.com\public_html\
I know you probably know all this anyway but using this method, I never have trouble linking back.

There is another possibility and that is the specificity (stupid word) of the css. Basically the last css is what's used. So if you used two styles sheets on a page and they both changed a p attribute to a different colour, the second declared css p colour is what's used.

Just thinking out loud really but often the obvious is missed !
 

Tai

HEAD CAPTAIN
Staff member
Administrator
May 11, 2003
14,279
2
2,645
515
United Kingdom
Thanks will give that a go tomorrow!

---------- Post Merged on 10-04-2015 at 11:32 AM ---------- Previous Post was on 09-04-2015 at 11:50 PM ----------

So just to confirm...when I put ../ in the DW template and then update my page, it changes it to

Code:
<link rel="stylesheet" type="text/css" href="file:///E|/My%20Website/css/global.css"/>

Is there a way I can stop this happening and force it to stay as ../ ?
 

Ardbeg

Legend
Legendary
Aug 8, 2004
3,211
1
144
260
Southern England
Does it change the path when you upload it to a live site or does it remain with the local address ?

I've been trying to recreate the same on my setup at home but not had much joy. I'm not really up on templates.
Are you using DW supplied templates or creating your own ?
I read that DW templates info, paths etc. are written to the registry so I assume that once they are set at the initial creation of your local site, they are rigidly set, hence it changes the path to what it wants.

All I can suggest is you make a test local site from scratch and create 2 sub directories, 1 for images and 1 for styles. Then create your first template page and initial stylesheet making sure you save them to your new directories and not DW's own repository for templates. Maybe it will then see them as the location to use.
 

Tai

HEAD CAPTAIN
Staff member
Administrator
May 11, 2003
14,279
2
2,645
515
United Kingdom
Does it change the path when you upload it to a live site or does it remain with the local address ?

I've been trying to recreate the same on my setup at home but not had much joy. I'm not really up on templates.
Are you using DW supplied templates or creating your own ?
I read that DW templates info, paths etc. are written to the registry so I assume that once they are set at the initial creation of your local site, they are rigidly set, hence it changes the path to what it wants.

All I can suggest is you make a test local site from scratch and create 2 sub directories, 1 for images and 1 for styles. Then create your first template page and initial stylesheet making sure you save them to your new directories and not DW's own repository for templates. Maybe it will then see them as the location to use.

It remains with the local address. It's the same on my menu's when trying to change directories. I'm sure there's a setting somewhere, something to do with relativity, but I can't find it. I would try your suggestion but I don't think I have the patience

This is a PITA because I'm going to end up having to detach every page from it's template and edit all the links to what they should be before I upload the finished site. Kind of defeats the point of templates.

But anyway now I'm having another problem in that I can't access any of my sub directories!

If I try to visit mysite.com/support for example:

Error 403 Foribbden
You don't have permission to access /support/.html on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Things I have checked:
There is an index.html file in the support folder
chmod rules are correct
.htaccess isn't blocking it

desk-flip.png
 

ESN

Loyal Member
Loyal Member
Jun 26, 2015
12
0
28
Undisclosed
Just adding a response as you've not advised if it is working now or not.

<link rel="stylesheet" href="/templates/styles/main.css" type="text/css" />

Short URLS for stylesheets should be used, unless you are using an offsite location. Don't put the home directory IE: website/css/global.css as your site reads from the home directory by default. Your stylesheet no matter on what page it is on or where the page is located, should always read to the location as indicated. You also need to make sure, your main stylesheet is the leading one within <head></head> -

Now the issue you are having with Dreamweaver, is that you are reading the site from directory rather than actual location and so will always default to the local address rather than a server address. Do you have Dreamweaver setup as a server? Also Dreamweaver isn't the best thing to be using to code a website, I would suggest using an editor like Sublime Text 2

The 403 error is the fact it's trying to read a file that is not a file /support/.html (what is the .html name?). Also check you only have .htaccess in your root and no where else, as this will create access conflicts on the server.