Setting a base directory when using a shared ssl

Hi,

I’m not sure if “base directory” is the right term to be used, but my problem is that the site I’m referring to uses root-based paths for setting images, style sheets, source files, etc… For example, “/images/header.jpg” or “/css/styles.css” both have the paths that start from the root (“/”).

However, if I want to use the shared SSL that my web host offers, the root paths get broken due to the extra directories that get added within the path (for example: https://serverhostname.com/~userdirectory/images/header.jpg or https://serverhostname.com/~userdirectory/css/styles.css) which causes all the images, style sheets, and other files to all not load correctly. Of course, setting a private SSL resolves the issue, but there are times when I’d prefer to use the shared SSL for a site.

Is there any way to set a base directory within the .htaccess file which would fix this, or are there any other ways to do this (possibly through PHP)? I know I could go through the entire site and set a PHP variable at the beginning of all paths, but I’d prefer not to go that route.

Can anyone provide any solutions form their experience?

Thanks!

Yes, use the fully qualified absolute link to the files.

The thing that you’ll have to worry about with respect to the absolute links is mixing http and https as using http links within your https pages will generate a LOT of warnings. Be smart about creating the absolute links within your secure scripts!

Regards,

DK