.htaccess regular expression question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deuce789
    New Member
    • Aug 2007
    • 31

    #1

    .htaccess regular expression question

    Hi,

    I am having an issue which i am sure there is an extremely easy fix for (just a little bit out of my knowledge of regular expressions).

    Basically i have two rules, and they conflict with one another, so only one or the other will work, not both, below are the 2 rules:

    Code:
    RewriteRule ^(.[^\/]*)/articles($|/$) /index.php?action=list_user_articles&p=$1
    RewriteRule ^search/articles($|/$) /index.php?p=search_articles
    Example URL's for both of these are below

    Code:
    /username_goes_here/articles/
    /search/articles/
    So basically, i need to somehow selectively make both of these rules work side by side depending on whether the first word is 'search' (go to second rule), or the first word isnt the word search (go to first rule).

    Any help with this would be greatly appreciated.

    Thanks,
    Steve
Working...