Apache2 mod_rewrite

Discussion in 'Server Operation' started by KenKnight, Mar 10, 2007.

  1. KenKnight

    KenKnight New Member

    Hi all,

    I'm assisting a client with creating an affiliate website and was investigating mod_rewrite as the solution.

    The idea is that a person on the net could hit a url like the following;

    http://www.companysite.com/member/membername

    This would go to the same subdirectory and page for every member where the page that displays would lookup info about the member based on the requested URL.

    I tried using the aliasmatch in much the same way that the vhosts_ispconfig.conf file does, however, if I put in something like;

    AliasMatch ^/member/([^/]+)(/(.*))? /var/www/web11/web/test

    and goto the following;

    http://www.companysite.com/member/MyName

    it gets sent to the following;
    Code:
    http://www.companysite.com/member/MyName/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/
    
    what might be causing this and is there a better way to handle something like this?

    Thanks
    Ken
     
  2. KenKnight

    KenKnight New Member

    Got it working!

    Hi all,

    Just posting back to say I got it working.

    I ended up using the following in an .htaccess file in the root directory;

    Code:
    RewriteEngine On
    
    RewriteRule ^members/(.*) index.php?var1=$1
    
    Simple enough.

    Cheers!
    ken
     

Share This Page