Htaccess problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • frizzle

    Htaccess problem

    Hi group,

    I have the htaccess code that is below to redirect everything to
    index.php exept for the mentioned folders. (img, swf, js and css)
    Now when i try to access domain.com/testfolder/img
    in Firefox i get redirected to domain.com/testfolder/img/?img
    How can i prevent this?

    And i was wondering if i could 'tell' the htaccess to use the folder
    it's in as root automatically.
    And somehow my values don't get passed to index.php. That doesn't make
    sense to me either ...

    # S T A R T H T A C C E S S # # # # # # # # # # # # # # # #

    RewriteEngine On

    RewriteBase /testfolder/
    RewriteRule ^((img|swf|js|c ss)(/.*)?){1}?$ - [PT]
    RewriteRule ^(.*)$ index\.php?$1 [L]

    # E N D H T A C C E S S # # # # # # # # # # # # # # # # # #

    Frizzle.

  • frizzle

    #2
    Re: Htaccess problem

    What i forgot to mention is that the excluded folders actually exist,
    the rest of them are fake.

    Frizzle.

    Comment

    • Paul Lautman

      #3
      Re: Htaccess problem

      frizzle wrote:[color=blue]
      > Hi group,
      >
      > I have the htaccess code that is below to redirect everything to
      > index.php exept for the mentioned folders. (img, swf, js and css)
      > Now when i try to access domain.com/testfolder/img
      > in Firefox i get redirected to domain.com/testfolder/img/?img
      > How can i prevent this?
      >
      > And i was wondering if i could 'tell' the htaccess to use the folder
      > it's in as root automatically.
      > And somehow my values don't get passed to index.php. That doesn't make
      > sense to me either ...
      >
      > # S T A R T H T A C C E S S # # # # # # # # # # # # # # # #
      >
      > RewriteEngine On
      >
      > RewriteBase /testfolder/
      > RewriteRule ^((img|swf|js|c ss)(/.*)?){1}?$ - [PT]
      > RewriteRule ^(.*)$ index\.php?$1 [L]
      >
      > # E N D H T A C C E S S # # # # # # # # # # # # # # # # # #
      >
      > Frizzle.[/color]

      I would suggest asking this in alt.apache.conf iguration.


      Comment

      • Rik

        #4
        Re: Htaccess problem

        frizzle wrote:[color=blue]
        > # S T A R T H T A C C E S S # # # # # # # # # # # # # # # #
        >
        > RewriteEngine On
        >
        > RewriteBase /testfolder/
        > RewriteRule ^((img|swf|js|c ss)(/.*)?){1}?$ - [PT][/color]
        ------------------------------------------^

        What's the questionmark doing there?
        Or the 'silly' {1} for that matter? (This is always implied, (#[.#]} is only
        needed when match isn't:
        - 1 (which it will assume if nothing is given).
        - 0 or 1 (the ?)
        - 0 or more (*)
        - 1 or more (+)
        I've never use PassThrough, but to me it seems it should be:
        RewriteRule ^(img|swf|js|cs s)/.*$ - [PT]

        [color=blue]
        > RewriteRule ^(.*)$ index\.php?$1 [L][/color]

        ---------------------------------^

        This dot doesn't need to be escaped

        As stated in another post, this isn't PHP, post in an apache ng.

        Grtz,
        --
        Rik Wasmus


        Comment

        • frizzle

          #5
          Re: Htaccess problem

          Rik wrote:[color=blue]
          > frizzle wrote:[color=green]
          > > # S T A R T H T A C C E S S # # # # # # # # # # # # # # # #
          > >
          > > RewriteEngine On
          > >
          > > RewriteBase /testfolder/
          > > RewriteRule ^((img|swf|js|c ss)(/.*)?){1}?$ - [PT][/color]
          > ------------------------------------------^
          >
          > What's the questionmark doing there?
          > Or the 'silly' {1} for that matter? (This is always implied, (#[.#]} is only
          > needed when match isn't:
          > - 1 (which it will assume if nothing is given).
          > - 0 or 1 (the ?)
          > - 0 or more (*)
          > - 1 or more (+)
          > I've never use PassThrough, but to me it seems it should be:
          > RewriteRule ^(img|swf|js|cs s)/.*$ - [PT]
          >
          >[color=green]
          > > RewriteRule ^(.*)$ index\.php?$1 [L][/color]
          >
          > ---------------------------------^
          >
          > This dot doesn't need to be escaped
          >
          > As stated in another post, this isn't PHP, post in an apache ng.
          >
          > Grtz,
          > --
          > Rik Wasmus[/color]

          Thank you both for pointing this out to me!
          I reposted the message (slightly modified thanks to Rik) on
          alt.apache.conf iguration
          under


          Frizzle.

          Comment

          Working...