Results 1 to 3 of 3

Thread: [RESOLVED] rewrite & regular expression

  1. #1
    Join Date
    Jan 2007

    resolved [RESOLVED] rewrite & regular expression

    I have a simple question I'm not able to resolve.

    I use this simple rule
    RewriteRule ^([A-Za-z0-9-]+)/?$ goto.php?team=$1 [L]

    to redirect the socer team to a personal page

    so if i write www.site.com/acmilan it redirect to www.site.com/album/index.php?id=xx

    The problems is that I'm creating a chat at the url www.site.com/chat but chat is not a team! lol!

    Do I have to modify the rewriterule ? How ?

    Can someone help me ?

    Thanks a lot!

  2. #2
    Join Date
    Dec 2005
    RewriteRule ^chat/?$ chat/ [L]
    RewriteRule ^([A-Za-z0-9-]+)/?$ goto.php?team=$1 [L]

    That's how I'd do it, the [L] flag means that if the rule is met and used, then don't use any rules after it. So seeing how the first rule would meet www.yoursite.com/chat and www.yoursite.com/chat/, then it won't be redirected.
    I've switched careers...
    I'm NO LONGER a scientist,
    but now a web developer...

  3. #3
    Join Date
    Jan 2007
    It was so clear and helpfully!

    Thanks! Fast and perfect!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center