Unable to mod rewrite ?g2_page=1

Discussion in 'Apache' started by kayanush, Sep 16, 2008.

  1. #1
    Hello,
    I use a gallery 2 script and I tried my best using help on the site to rewrite ?g2_page=1

    Here is what I wanted to do:

    www.domain.com/wallpapers/?g2_page=1

    it should redirect to www.domain.com/wallpapers/

    www.domain.com/wallpapers/nature/?g2_page=1

    it should redirect to www.domain.com/wallpapers/nature/

    BTW, it should not redirect pages with subsequent numbers like ?g2_page=2 or ?g2_page=3 etc etc


    I tried with the following -

    Rewriterule ^([^/]*)/+?g2_page1$ /wallpapers/$1/$2/ [R=301,L]

    Rewriterule ^([^/]*)/+([^/]*)/+?g2_page1$ /wallpapers/$1/$2/$3-$4 [R=301,L]

    It fails where am I going wrong?
     
    kayanush, Sep 16, 2008 IP
  2. justinlorder

    justinlorder Peon

    Messages:
    4,160
    Likes Received:
    61
    Best Answers:
    0
    Trophy Points:
    0
    #2
    rewrite is complex . I am always use the default setting .
    First step is to check if the .htaccess file works.
    Then check the other elements affect the rewrite affects.
     
    justinlorder, Sep 16, 2008 IP
  3. NsaneNoob

    NsaneNoob Peon

    Messages:
    2,103
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You cannot use it if you have a Windows Hosting Server.
     
    NsaneNoob, Sep 16, 2008 IP
  4. nimhost

    nimhost Active Member

    Messages:
    235
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #4
    he still can use it as long mod_rewrite was enable on the server :)
     
    nimhost, Sep 16, 2008 IP
  5. NsaneNoob

    NsaneNoob Peon

    Messages:
    2,103
    Likes Received:
    59
    Best Answers:
    0
    Trophy Points:
    0
    #5
    From what I know, it is never possible on a Windows Server. That is what is happening with my hosting company currently.
     
    NsaneNoob, Sep 16, 2008 IP