6 Replies Latest reply on Jul 31, 2007 9:23 PM by Newsgroup_User

    stupid question #6431: paths/mappings/etc

    Level 7

      Hi all...here's goes nothing...

      I've got an issue using root relative paths.

      In my local root folder set up in the coldFusion wwwroot folder as.
      E.G. "blah blah\CFusionMX\wwwroot\mySite\"

      Now, if I want to use, say "/imgFolder/imgFile.gif" to point to an image
      file on a page in mySite, it ends up pointing to:
      wwwroot/imgFolder/imgFile.gif rather than
      wwwroot/mySite/imgFolder/imgFile.gif.

      I can't use document relative paths because I have many includes into pages
      which are not always on the same relative directory level.
      I can use a webroot variable but that seems to be excessive having to call
      and output application.webRoot whenever I want to use a root relative path.

      I can always type"/mySite/imgFolder/imgFile.gif" but then I'de need to use
      what seems to me a pointless extra folder level on the remote server so that
      the remote root is no longer at "/" but at "/mySite/" and that seems rather
      sloppy to me.

      I feel I'm missing what is a really basic aspect to setting up sites, so if
      anyone can explain it, I'd be stoked (as always) to learn it.


      Tks,

      Lossed
      __when the only tool you have is a hammer, everything looks like a nail __


        • 1. Re: stupid question #6431: paths/mappings/etc
          Level 7
          Anyone?

          "Lossed" <blankemail@hotmail.com> wrote in message
          news:f88lh2$bne$1@forums.macromedia.com...
          >
          > Hi all...here's goes nothing...
          >
          > I've got an issue using root relative paths.
          >
          > In my local root folder set up in the coldFusion wwwroot folder as.
          > E.G. "blah blah\CFusionMX\wwwroot\mySite\"
          >
          > Now, if I want to use, say "/imgFolder/imgFile.gif" to point to an image
          > file on a page in mySite, it ends up pointing to:
          > wwwroot/imgFolder/imgFile.gif rather than
          > wwwroot/mySite/imgFolder/imgFile.gif.
          >
          > I can't use document relative paths because I have many includes into
          > pages which are not always on the same relative directory level.
          > I can use a webroot variable but that seems to be excessive having to call
          > and output application.webRoot whenever I want to use a root relative
          > path.
          >
          > I can always type"/mySite/imgFolder/imgFile.gif" but then I'de need to use
          > what seems to me a pointless extra folder level on the remote server so
          > that the remote root is no longer at "/" but at "/mySite/" and that seems
          > rather sloppy to me.
          >
          > I feel I'm missing what is a really basic aspect to setting up sites, so
          > if anyone can explain it, I'd be stoked (as always) to learn it.
          >
          >
          > Tks,
          >
          > Lossed
          > __when the only tool you have is a hammer, everything looks like a nail __
          >


          • 2. Re: stupid question #6431: paths/mappings/etc
            Level 7
            Have I outdone myself and sinked to a new level of stupidity that voids all
            hope of a constructive solution? ;)

            The OP again:


            Hi all...here's goes nothing...

            I've got an issue using root relative paths.

            In my local root folder set up in the coldFusion wwwroot folder as.
            E.G. "blah blah\CFusionMX\wwwroot\mySite\"

            Now, if I want to use, say "/imgFolder/imgFile.gif" to point to an image
            file on a page in mySite, it ends up pointing to:
            wwwroot/imgFolder/imgFile.gif rather than
            wwwroot/mySite/imgFolder/imgFile.gif.

            I can't use document relative paths because I have many includes into pages
            which are not always on the same relative directory level.
            I can use a webroot variable but that seems to be excessive having to call
            and output application.webRoot whenever I want to use a root relative path.

            I can always type"/mySite/imgFolder/imgFile.gif" but then I'de need to use
            what seems to me a pointless extra folder level on the remote server so that
            the remote root is no longer at "/" but at "/mySite/" and that seems rather
            sloppy to me.

            I feel I'm missing what is a really basic aspect to setting up sites, so if
            anyone can explain it, I'd be stoked (as always) to learn it.


            Tks,

            Lossed
            __when the only tool you have is a hammer, everything looks like a nail __


            "Lossed" <blankemail@hotmail.com> wrote in message
            news:f88lh2$bne$1@forums.macromedia.com...
            >
            > Hi all...here's goes nothing...
            >
            > I've got an issue using root relative paths.
            >
            > In my local root folder set up in the coldFusion wwwroot folder as.
            > E.G. "blah blah\CFusionMX\wwwroot\mySite\"
            >
            > Now, if I want to use, say "/imgFolder/imgFile.gif" to point to an image
            > file on a page in mySite, it ends up pointing to:
            > wwwroot/imgFolder/imgFile.gif rather than
            > wwwroot/mySite/imgFolder/imgFile.gif.
            >
            > I can't use document relative paths because I have many includes into
            > pages which are not always on the same relative directory level.
            > I can use a webroot variable but that seems to be excessive having to call
            > and output application.webRoot whenever I want to use a root relative
            > path.
            >
            > I can always type"/mySite/imgFolder/imgFile.gif" but then I'de need to use
            > what seems to me a pointless extra folder level on the remote server so
            > that the remote root is no longer at "/" but at "/mySite/" and that seems
            > rather sloppy to me.
            >
            > I feel I'm missing what is a really basic aspect to setting up sites, so
            > if anyone can explain it, I'd be stoked (as always) to learn it.
            >
            >
            > Tks,
            >
            > Lossed
            > __when the only tool you have is a hammer, everything looks like a nail __
            >


            • 3. Re: stupid question #6431: paths/mappings/etc
              Level 7
              simple question: Is the site defined to the real public root of the site, or
              is it defined to a higher level private ftp folder?

              define the site to the folder containing the site's "homepage" index file.
              Use the "host directory" line in the remote server info to adjust the folder
              level. Guessing from the example paths you gave, type wwwroot into that
              line. Or whatever the name of the folder that public site files have to be
              in. Such as public_html or httpdocs or www on some servers.

              If for some reason you want to define the site to the upper level private
              ftp folder and not the subfolder where the public site root is, don't use
              site relative paths- dw will get them wrong because you've given dw wrong
              information on where the site root is.

              --
              Alan
              Adobe Community Expert, dreamweaver

              http://www.adobe.com/communities/experts/



              • 4. Re: stupid question #6431: paths/mappings/etc
                Level 7
                Hi Alan,

                Remote folder is /wwwroot/ and is where the home page resides, so I think
                that's fine.

                Local root folder is:
                C:\Program Files\Macromedia\CFusionMX\wwwroot\mySite\

                Local testing server folder is:
                C:\Program Files\Macromedia\CFusionMX\wwwroot\mySite

                When I preview a page locally via F12, any root relative links point to:
                http://localhost:8500/

                rather than http://localhost:8500/mySite/

                and are thus broken.

                How can I get these to point to http://localhost:8500/mySite/ ?

                I can't use document relative paths for, say, a main css file that's
                included on every page regardless of what folder level the page is at, b/c
                the css is included via a generic head include, and while I could use a
                webroot variable in the include to give it an absolute path to the css file,
                it's yet another variable the application server has to find then output,
                which I'd like to avoid and surely there has to be a way of simply using a
                root relative path to achieve the same thing?

                It's got to be something simple that I just can't see.

                Regards,
                Lossed


                "Alan" <please_dont_mail_me@example.com> wrote in message
                news:C2D2B2BA.2D5309%please_dont_mail_me@example.com...
                > simple question: Is the site defined to the real public root of the site,
                > or
                > is it defined to a higher level private ftp folder?
                >
                > define the site to the folder containing the site's "homepage" index file.
                > Use the "host directory" line in the remote server info to adjust the
                > folder
                > level. Guessing from the example paths you gave, type wwwroot into that
                > line. Or whatever the name of the folder that public site files have to be
                > in. Such as public_html or httpdocs or www on some servers.
                >
                > If for some reason you want to define the site to the upper level private
                > ftp folder and not the subfolder where the public site root is, don't use
                > site relative paths- dw will get them wrong because you've given dw wrong
                > information on where the site root is.
                >
                > --
                > Alan
                > Adobe Community Expert, dreamweaver
                >
                > http://www.adobe.com/communities/experts/
                >
                >
                >


                • 5. Re: stupid question #6431: paths/mappings/etc
                  Level 7


                  > When I preview a page locally via F12, any root relative links point to:
                  > http://localhost:8500/
                  >
                  > rather than http://localhost:8500/mySite/
                  >
                  > and are thus broken.
                  >
                  > How can I get these to point to http://localhost:8500/mySite/

                  google on how to create a "virtual host" for the os/server combination you
                  are using.
                  There's two things to set up. First set your server config files so it knows
                  what directory to use when this virtual host is requested. Then set your OS
                  so it knows what is meant when mysite.local is typed into a browser- that
                  it's a locally defined thing and to not to try to resolve it using an
                  internet based DNS namesever. This is in the hosts file on windows for
                  example.

                  Then you can use a testing server url of http://thissite.local/ so root
                  relative paths work in the testing server.

                  --
                  Alan
                  Adobe Community Expert, dreamweaver

                  http://www.adobe.com/communities/experts/



                  • 6. Re: stupid question #6431: paths/mappings/etc
                    Level 7
                    Thank you so much for all your help with this Alan.
                    I have finally managed to get my head around installing and configuring
                    Apache, connecting CFMX to it, and setting up the virtual hosts for each
                    site. What a marathon crash course!

                    "Alan" <please_dont_mail_me@example.com> wrote in message
                    news:C2D2D170.2D5358%please_dont_mail_me@example.com...
                    >
                    >
                    >> When I preview a page locally via F12, any root relative links point to:
                    >> http://localhost:8500/
                    >>
                    >> rather than http://localhost:8500/mySite/
                    >>
                    >> and are thus broken.
                    >>
                    >> How can I get these to point to http://localhost:8500/mySite/
                    >
                    > google on how to create a "virtual host" for the os/server combination you
                    > are using.
                    > There's two things to set up. First set your server config files so it
                    > knows
                    > what directory to use when this virtual host is requested. Then set your
                    > OS
                    > so it knows what is meant when mysite.local is typed into a browser- that
                    > it's a locally defined thing and to not to try to resolve it using an
                    > internet based DNS namesever. This is in the hosts file on windows for
                    > example.
                    >
                    > Then you can use a testing server url of http://thissite.local/ so root
                    > relative paths work in the testing server.
                    >
                    > --
                    > Alan
                    > Adobe Community Expert, dreamweaver
                    >
                    > http://www.adobe.com/communities/experts/
                    >
                    >
                    >