.htaccess help

Discussion in 'Site & Server Administration' started by Synchronium, Oct 9, 2007.

  1. #1
    Hi,

    I've just wrote a blog. I'm having problems with my htaccess file in differentiating between /blog/article_title/ and /blog/rss/

    Here's my htaccess file:

    RewriteRule ^blog/rss/$ /blog.php?method=rss
    RewriteRule ^blog/?([^/]+)?/?$ /blog.php?method=view&title=$1

    But, it thinks "rss" is the title and passes it to $1 in the second rule.

    How can I get /blog/rss/ to go to /blog.php?method=rss and NOT /blog.php?method=view&title=rss?

    Many thanks in advance.
     
    Synchronium, Oct 9, 2007 IP
  2. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    well looking at the rules you got the rule itself appears to be fine.
    what youmight need to do is add [L] at the end of the rule so it knows to stop processing the rules and goto that page, without the [L] it'd just keep going.
     
    powerspike, Oct 9, 2007 IP
  3. powerspike

    powerspike Peon

    Messages:
    312
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    RewriteRule ^blog/rss/$ /blog.php?method=rss [L]
    RewriteRule ^blog/?([^/]+)?/?$ /blog.php?method=view&title=$1 [L]

    [L] stands for "last"
     
    powerspike, Oct 9, 2007 IP
  4. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #4
    Still doesn't work. Thanks though.

    I need a rule that says "if it's not a back slash AND it's not 'rss', go to /?page=blog&title

    :(
     
    Synchronium, Oct 10, 2007 IP
  5. Synchronium

    Synchronium Active Member

    Messages:
    463
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    58
    #5
    No one else?
     
    Synchronium, Oct 10, 2007 IP