pulling my hair on this .htaccess problem

Discussion in 'Apache' started by Andy$$$, Nov 23, 2007.

  1. #1
    Hello!

    I have a problem I can't figure out.

    I have this in my .htaccess and it is not working. If I go to the url I just get redirected to the 404 page.

    ErrorDocument 404 /404.html
    RewriteEngine on
    RewriteRule search\.php?title=888888 /updated/?a=search&n=0&category=title&q=88888

    To me the above looks correct what do you think?

    Thanks in advanced.
     
    Andy$$$, Nov 23, 2007 IP
  2. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #2
    replace your above line by below and test again:

    RewriteRule ^search\.php?title=888888$ /updated/?a=search&n=0&category=title&q=88888 [L]


    of course you have to make sure you have the title

    title=888888

    existing else you get a correct 404
     
    hans, Nov 27, 2007 IP
  3. Andy$$$

    Andy$$$ Peon

    Messages:
    205
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks Hans but for some reason it didn't work =/
     
    Andy$$$, Dec 1, 2007 IP
  4. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #4
    sri to hear that
    here in DP forum >> may be PM nintendo
    he is the true king of mod_rewrite stuff !!!
     
    hans, Dec 1, 2007 IP
  5. Ladadadada

    Ladadadada Peon

    Messages:
    382
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #5
    What do you get if you request /updated/?a=search&n=0&category=title&q=88888 ?

    If that's a 404 then you will need to make that page work first.
     
    Ladadadada, Dec 8, 2007 IP
  6. hans

    hans Well-Known Member

    Messages:
    2,923
    Likes Received:
    126
    Best Answers:
    1
    Trophy Points:
    173
    #6
    Andy$$$

    if you still search for a solution - it definitely would help a LOT to give at least the domain-URL of the site in question before asking more questions.
    without knowing server details much of possible help is more guesswork/waste of time than efficient help
     
    hans, Dec 8, 2007 IP
  7. buldozerceto

    buldozerceto Active Member

    Messages:
    1,137
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    88
    #7
    try this code

    RewriteEngine on
    RewriteBase /updated
    ErrorDocument 404 /404.html
    RewriteRule search\.php?title=888888 /?a=search&n=0&category=title&q=88888 [L]

    or


    RewriteEngine on
    RewriteBase /
    ErrorDocument 404 /404.html
    RewriteRule search\.php?title=888888 /updated/?a=search&n=0&category=title&q=88888 [L]
     
    buldozerceto, Dec 11, 2007 IP