Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

"http://domain.com/subdirectory" vs "http://subdomain.domain.com"

2»

Comments

  • edited May 2007
    Vanilla use relative path url, the domain name is not used. But all the paths are relative to the web root.

    '/subdirectory/themes/vanilla/styles/default/vanilla.css' is a relative path url;
    'themes/vanilla/styles/default/vanilla.css' is a relative path url;
    'http://domain.com/subdirectory/themes/vanilla/styles/default/vanilla.css' is an absolute path url;

    The second one is to avoid because it doesn't work very well with friendly urls.

    The problem in your casein some case when changing the location of the forum is that vanilla save in the database '/subdirectory/themes/vanilla/styles/default/' when it would be better to have 'themes/vanilla/styles/default/' and build the url like vanilla do for other urls
  • What do you mean in your final statement Dinoboff? As you say though, all paths are relative to the web root, but the web root changes depending which method of access you use, therefore the complete path changes too which causes the breakdown. Surely that's the issue?
  • edited May 2007
    You can try to replace lines 83 and 84 of appg/init_vanilla.php (Ithink) with :$StylePath = $Context->StyleUrl; $StylePath = ereg_replace("^".$Context->Configuration['WEB_ROOT'], '', $StylePath); $Head->AddStyleSheet($StylePath.'vanilla.css', 'screen', 100, '~'); $Head->AddStyleSheet($StylePath.'vanilla.print.css', 'print', 101, '~');
  • @Mini: nevermind, I thought he had two installations using the same DB, I thought there was only a problem with the style related urls.
  • Ahh right. OK.
  • lechlech Chicagoland
    Essentially this counts as a single installation acting as 2 from what I can tell based on how it's being described. You have the following setup:

    www.domain.com/subdirectory/

    which is aliased to:

    subdomain.domain.com

    The relative path to the initial installation would be /subdirectory/ which the alias setup is feeding out based on the initial install which is relative to the theme and style location. This doesn't work because of that reason as Vanilla doesn't really support duality in this manner. It's either going to be one or the other but not both.

    if this was set up as either two different subdomains or two different top level domains within a subdirectory of the same name, it could work. Although there would then be a cookie issue to contend with as Vanilla would have to Validate against one primary setup.
  • Dinoboff may have phrased things in a much clearer manner than I did.
    He said:
    > "...vanilla save[s] in the database '/subdirectory/themes/vanilla/styles/default/' when
    > it would be better to have 'themes/vanilla/styles/default/' and build the url like vanilla
    > do for other urls."

    YES!!! Exactly! There is nor reason at all for vanilla to have "/subdirectory/" in any path or URL,
    as all URLs can be treated as relative to the location of index.php, just as one would in
    straight html hrefs.

    He later said:

    >> I thought there was only a problem with the style related urls.

    That's all it is - the information shows up, but it shows up as a single html page,
    without the frames and css treatment. Form what I can see, the only problem
    here is picking up the "style" stuff, as the links "work" and information shows
    up just fine, but is unformatted.

    So, I think the problem here is that vanilla attempts to store (and use) the URL
    information "above" the location of index.php, and this is what confuses
    (some say it "breaks") things.

    If there is some valid need to know the URL to index.php, this sounds
    to melike an excellent thing to put in the config files, so that relocation
    of discussion groups would require a backup, a restore, and an FTP of
    one file with one changed value.

    But there is no need for any code to "build" the URL.
    Let the servers and browsers handle the URLs, as
    they do a fine job without any help from applcation
    code.

    The use of cookies that reference a URL subdirectory is, ummm... strange.
    Yes, something unique is needed for multi-discussion-group sites,
    but how 'bout the assigned name of the group, rather than something
    that depends upon physical location or URLs?

    But don't get me wrong, vanilla is very nice and clean.
  • edited May 2007
    I think you forgot the important bit, relative paths can't work because with friendly urls.

    From this page - /community/discussion/6423/httpdomaincomsubdirectory-vs-httpsubdomaindomaincom/-
    index.php or discussions/ mean /community/discussion/6423/httpdomaincomsubdirectory-vs-httpsubdomaindomaincom/discussions/

    That's why we need to use links url with the base url like /community/discussions/
  • edited May 2007
    If you want your website accessible from the two addresses, you will need two installationa (maybe just too differents conf folder)
  • edited May 2007
    "If there is some valid need to know the URL to index.php, this sounds to melike an excellent thing to put in the config files," that IS in the config files, it's called the BASE_URL, but you have more than one URL, that's the problem. Open your conf/settings.php file, locate the line: $Configuration['DEFAULT_STYLE'] = '...'; and change it to: $Configuration['DEFAULT_STYLE'] = 'http://www.domain.com/subdir/...'; Save the file and upload it. That will make the style work. But I still think you'll have other much bigger issues. This is going to be much more of a headache than it's worth, and in the end all the links will just point to www.domain.com/subdir/ anyway surely?
This discussion has been closed.