Hello all,

I need to be able to get a folder name, the folder name based on the name of the website member eg (www.website.com/members/john123) it would then get the username John123 and then use this information to access his account.

The files the server would get would be from something like: (www.website.com/files/profile.php?user=john123) but would show to the user as (www.website.com/members/john123/profile.php)

I have looked every where, and cant find anything. But I know it can be done as I have come accross this before, a couple of year back!

Thank you!!!🙂

    Hmm, I'm no expert on .htaccess redirects. One thing you can do is write a script("members"), use an Apache ForceType directive to parse it with PHP, and have the script read the username from the URI request string ... dunno if this would be what you want, but it looks close.

    For example, I have an "articles" script. It reads the article name thus:

    http://mysite.com/articles/Read_this_please

    and the script pulls the article with that title into the page.

      You can do something like this
      User accesses http://www.somewebsite.com/members/sampleuser
      .htaccess

      RewriteEngine on    
      RewriteRule ^members/([^/\.]*)/?([^/\.]*)/?$ /files/profile.php?user=$1 [L]

      Then on the files/profile.php page do a simple get

      $user = $_GET['user']; 
      

      $user would equal sampleuser.

        Write a Reply...