Loading ...
Sorry, an error occurred while loading the content.

Ajile and mod rewrite

Expand Messages
  • jwilhite22
    Hey there, I m currently developing a custom php application for internal use and was hoping to implement Ajile for to help organize the javascript bits. I
    Message 1 of 4 , Jan 5, 2007
    • 0 Attachment
      Hey there,
      I'm currently developing a custom php application for internal use and
      was hoping to implement Ajile for to help organize the javascript bits.
      I have hit a snag however. We are using apache's mod rewrite to
      pretty-up the URLs so anything that goes to

      http://www.test.com/app/Home/

      gets rewritten and is in actuality going to

      http://www.test.com/app/index.php?url=Home

      When I include Ajile.0.7.8 it seems to always check for the index.js
      file relative to the current URL (looks like the code is using the
      document.location.href). Unfortunately with the rewritten URLs that
      location is incorrect. So I guess what I'm after is:


      1. Is there a way to STOP the initial Ajile from even checking for
      the index.js file? I dont necessarily need that functionality. I have
      tried the mvcshareoff option and it still appears to check for the file.
      The problem here is that while the correct index.js file is not
      there..mod rewrite sends the request to the default page of the site if
      its a file that cannot be found....so an entire page gets returned and
      causes an error.
      2. Is there a way to feed Ajile the appropriate location to look in
      for the correct index.js? For instance is there a property that can be
      set identifying the installation directory of Ajile so that it does not
      try to use the document.location.href. Just in case I ever do want to
      use the functionality.

      Any help would be appreciated. I'm not the sharpest knife in the drawer
      some days so if I am missing something obvious please be gentle.

      Thanks much. [:)]




      [Non-text portions of this message have been removed]
    • iskitzdev
      Hi, Ajile shouldn t load index.js if you use the mvcshareoff option when loading Ajile. If your index.js file is in the same location as your index.php it will
      Message 2 of 4 , Jan 9, 2007
      • 0 Attachment
        Hi,
        Ajile shouldn't load index.js if you use the mvcshareoff option when
        loading Ajile. If your index.js file is in the same location as your
        index.php it will always be loaded unless you also use the mvcoff
        option when loading Ajile. The mvcoff option will tell Ajile not to
        load the default external script for the current page, so basically if
        you use both the mvcshareoff and mvcoff options Ajile won't
        automatically load any external scripts. This is useful for pages that
        use Ajile via inline scripting but may also fit your situation.

        If you could outline your directory structure showing the locations of
        Ajile, index.js and any pages or scripts using Ajile it would be very
        helpful.

        Also you mentioned that when the URLs are rewritten
        document.location.href is no longer correct, do you know if any other
        JavaScript value (i.e. document.URL) holds the correct location?

        Cheers,
        Michael

        --- In ajile@yahoogroups.com, "jwilhite22" <jwilhite22@...> wrote:
        >
        > Hey there,
        > I'm currently developing a custom php application for internal use and
        > was hoping to implement Ajile for to help organize the javascript bits.
        > I have hit a snag however. We are using apache's mod rewrite to
        > pretty-up the URLs so anything that goes to
        >
        > http://www.test.com/app/Home/
        >
        > gets rewritten and is in actuality going to
        >
        > http://www.test.com/app/index.php?url=Home
        >
        > When I include Ajile.0.7.8 it seems to always check for the index.js
        > file relative to the current URL (looks like the code is using the
        > document.location.href). Unfortunately with the rewritten URLs that
        > location is incorrect. So I guess what I'm after is:
        >
        >
        > 1. Is there a way to STOP the initial Ajile from even checking for
        > the index.js file? I dont necessarily need that functionality. I have
        > tried the mvcshareoff option and it still appears to check for the file.
        > The problem here is that while the correct index.js file is not
        > there..mod rewrite sends the request to the default page of the site if
        > its a file that cannot be found....so an entire page gets returned and
        > causes an error.
        > 2. Is there a way to feed Ajile the appropriate location to look in
        > for the correct index.js? For instance is there a property that can be
        > set identifying the installation directory of Ajile so that it does not
        > try to use the document.location.href. Just in case I ever do want to
        > use the functionality.
        >
        > Any help would be appreciated. I'm not the sharpest knife in the drawer
        > some days so if I am missing something obvious please be gentle.
        >
        > Thanks much. [:)]
        >
        >
        >
        >
        > [Non-text portions of this message have been removed]
        >
      • jwilhite22
        Thanks much. For some reason I thought I had tried it with both the mvcschareoff and mvcoff. Seems I had not. Worked perfectly. I was not able to find another
        Message 3 of 4 , Jan 11, 2007
        • 0 Attachment
          Thanks much.

          For some reason I thought I had tried it with both the mvcschareoff
          and mvcoff. Seems I had not. Worked perfectly.

          I was not able to find another JavaScript variable that holds the
          correct location. Since the url rewriting is done on the server it
          looks as if all JavaScript ever gets is the initial "pretty" url. If
          that is the case the only solution that I could think of would be to
          add the ability to specify the current url/path to pull from.

          At this point the mvc functionality is not a necessity but I can
          certainly see situations in which it would be useful later.

          Thanks again for the help.

          --- In ajile@yahoogroups.com, "iskitzdev" <iskitzdev@...> wrote:
          >
          > Hi,
          > Ajile shouldn't load index.js if you use the mvcshareoff option when
          > loading Ajile. If your index.js file is in the same location as your
          > index.php it will always be loaded unless you also use the mvcoff
          > option when loading Ajile. The mvcoff option will tell Ajile not to
          > load the default external script for the current page, so basically if
          > you use both the mvcshareoff and mvcoff options Ajile won't
          > automatically load any external scripts. This is useful for pages that
          > use Ajile via inline scripting but may also fit your situation.
          >
          > If you could outline your directory structure showing the locations of
          > Ajile, index.js and any pages or scripts using Ajile it would be very
          > helpful.
          >
          > Also you mentioned that when the URLs are rewritten
          > document.location.href is no longer correct, do you know if any other
          > JavaScript value (i.e. document.URL) holds the correct location?
          >
          > Cheers,
          > Michael
          >
          > --- In ajile@yahoogroups.com, "jwilhite22" <jwilhite22@> wrote:
          > >
          > > Hey there,
          > > I'm currently developing a custom php application for internal use and
          > > was hoping to implement Ajile for to help organize the javascript
          bits.
          > > I have hit a snag however. We are using apache's mod rewrite to
          > > pretty-up the URLs so anything that goes to
          > >
          > > http://www.test.com/app/Home/
          > >
          > > gets rewritten and is in actuality going to
          > >
          > > http://www.test.com/app/index.php?url=Home
          > >
          > > When I include Ajile.0.7.8 it seems to always check for the index.js
          > > file relative to the current URL (looks like the code is using the
          > > document.location.href). Unfortunately with the rewritten URLs that
          > > location is incorrect. So I guess what I'm after is:
          > >
          > >
          > > 1. Is there a way to STOP the initial Ajile from even checking for
          > > the index.js file? I dont necessarily need that functionality. I have
          > > tried the mvcshareoff option and it still appears to check for the
          file.
          > > The problem here is that while the correct index.js file is not
          > > there..mod rewrite sends the request to the default page of the
          site if
          > > its a file that cannot be found....so an entire page gets returned and
          > > causes an error.
          > > 2. Is there a way to feed Ajile the appropriate location to
          look in
          > > for the correct index.js? For instance is there a property that can be
          > > set identifying the installation directory of Ajile so that it
          does not
          > > try to use the document.location.href. Just in case I ever do want to
          > > use the functionality.
          > >
          > > Any help would be appreciated. I'm not the sharpest knife in the
          drawer
          > > some days so if I am missing something obvious please be gentle.
          > >
          > > Thanks much. [:)]
          > >
          > >
          > >
          > >
          > > [Non-text portions of this message have been removed]
          > >
          >
        • iskitzdev
          No problem glad we were able to solve the problem. Good Luck! ... use and ... checking for ... I have ... returned and ... can be ... want to
          Message 4 of 4 , Jan 13, 2007
          • 0 Attachment
            No problem glad we were able to solve the problem.

            Good Luck!

            --- In ajile@yahoogroups.com, "jwilhite22" <jwilhite22@...> wrote:
            >
            > Thanks much.
            >
            > For some reason I thought I had tried it with both the mvcschareoff
            > and mvcoff. Seems I had not. Worked perfectly.
            >
            > I was not able to find another JavaScript variable that holds the
            > correct location. Since the url rewriting is done on the server it
            > looks as if all JavaScript ever gets is the initial "pretty" url. If
            > that is the case the only solution that I could think of would be to
            > add the ability to specify the current url/path to pull from.
            >
            > At this point the mvc functionality is not a necessity but I can
            > certainly see situations in which it would be useful later.
            >
            > Thanks again for the help.
            >
            > --- In ajile@yahoogroups.com, "iskitzdev" <iskitzdev@> wrote:
            > >
            > > Hi,
            > > Ajile shouldn't load index.js if you use the mvcshareoff option when
            > > loading Ajile. If your index.js file is in the same location as your
            > > index.php it will always be loaded unless you also use the mvcoff
            > > option when loading Ajile. The mvcoff option will tell Ajile not to
            > > load the default external script for the current page, so basically if
            > > you use both the mvcshareoff and mvcoff options Ajile won't
            > > automatically load any external scripts. This is useful for pages that
            > > use Ajile via inline scripting but may also fit your situation.
            > >
            > > If you could outline your directory structure showing the locations of
            > > Ajile, index.js and any pages or scripts using Ajile it would be very
            > > helpful.
            > >
            > > Also you mentioned that when the URLs are rewritten
            > > document.location.href is no longer correct, do you know if any other
            > > JavaScript value (i.e. document.URL) holds the correct location?
            > >
            > > Cheers,
            > > Michael
            > >
            > > --- In ajile@yahoogroups.com, "jwilhite22" <jwilhite22@> wrote:
            > > >
            > > > Hey there,
            > > > I'm currently developing a custom php application for internal
            use and
            > > > was hoping to implement Ajile for to help organize the javascript
            > bits.
            > > > I have hit a snag however. We are using apache's mod rewrite to
            > > > pretty-up the URLs so anything that goes to
            > > >
            > > > http://www.test.com/app/Home/
            > > >
            > > > gets rewritten and is in actuality going to
            > > >
            > > > http://www.test.com/app/index.php?url=Home
            > > >
            > > > When I include Ajile.0.7.8 it seems to always check for the index.js
            > > > file relative to the current URL (looks like the code is using the
            > > > document.location.href). Unfortunately with the rewritten URLs that
            > > > location is incorrect. So I guess what I'm after is:
            > > >
            > > >
            > > > 1. Is there a way to STOP the initial Ajile from even
            checking for
            > > > the index.js file? I dont necessarily need that functionality.
            I have
            > > > tried the mvcshareoff option and it still appears to check for the
            > file.
            > > > The problem here is that while the correct index.js file is not
            > > > there..mod rewrite sends the request to the default page of the
            > site if
            > > > its a file that cannot be found....so an entire page gets
            returned and
            > > > causes an error.
            > > > 2. Is there a way to feed Ajile the appropriate location to
            > look in
            > > > for the correct index.js? For instance is there a property that
            can be
            > > > set identifying the installation directory of Ajile so that it
            > does not
            > > > try to use the document.location.href. Just in case I ever do
            want to
            > > > use the functionality.
            > > >
            > > > Any help would be appreciated. I'm not the sharpest knife in the
            > drawer
            > > > some days so if I am missing something obvious please be gentle.
            > > >
            > > > Thanks much. [:)]
            > > >
            > > >
            > > >
            > > >
            > > > [Non-text portions of this message have been removed]
            > > >
            > >
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.