[HELP] Make user profiles .htaccess?

Results 1 to 6 of 6
  1. #1
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    [HELP] Make user profiles .htaccess?

    Hi, I want to be able to make user profiles like this:

    Code:
    www.site.com/username
    Instead of things like:

    Code:
    www.site.com/profile/username
    So, in my .htaccess file I have:

    Code:
    RewriteEngine On
    RewriteRule ^/(.*)$ profile.php?user=$1 [L]
    But then, that means if I go to a link like

    Code:
    www.site.com/contact/
    In .htaccess it will process:

    Code:
    www.site.com/profile.php?user=contact
    Any ideas on how to do it? I've seen it on other sites and it works fine for them.

    Any usefull help will be fully appreciated and 'thanked'.

    Thanks,
    - m0nsta.
    Last edited by Markshall; 15-07-10 at 08:39 PM.


  2. #2
    Zzzz... billybombill is offline
    MemberRank
    Dec 2008 Join Date
    1,355Posts

    Re: [HELP] Make user profiles .htaccess?

    Put a .htaccess in a folder, make a .htusers for that specific folder. Done.

    .htaccess Tutorial - Part 1

    Edit: Ehh NVM looks like your trying to do something a little different, above link might help you anyways
    Last edited by billybombill; 15-07-10 at 08:49 PM.

  3. #3
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [HELP] Make user profiles .htaccess?

    Quote Originally Posted by billybombill View Post
    Put a .htaccess in a folder, make a .htusers for that specific folder. Done.

    .htaccess Tutorial - Part 1

    Edit: Ehh NVM looks like your trying to do something a little different, above link might help you anyways
    Thanks for your help, but my PC has a virus and I can't view certain sites, but I'm buying a new harddrive next week so that should fix the problem, so when I get it I'll check that link out.

    I thanked you.

  4. #4
    Mother effin' clouds SaintsIan is offline
    MemberRank
    Apr 2008 Join Date
    fyrechat.netLocation
    2,809Posts

    Re: [HELP] Make user profiles .htaccess?

    Quote Originally Posted by m0nsta. View Post
    Hi, I want to be able to make user profiles like this:

    Code:
    www.site.com/username
    Instead of things like:

    Code:
    www.site.com/profile/username
    So, in my .htaccess file I have:

    Code:
    RewriteEngine On
    RewriteRule ^/(.*)$ profile.php?user=$1 [L]
    But then, that means if I go to a link like

    Code:
    www.site.com/contact/
    In .htaccess it will process:

    Code:
    www.site.com/profile.php?user=contact
    Any ideas on how to do it? I've seen it on other sites and it works fine for them.

    Any usefull help will be fully appreciated and 'thanked'.

    Thanks,
    - m0nsta.
    Add a rewrite rule for your matching pages (e.g. aboutus, contact, home), then below that, keep the user profile rules.

    For example:
    Code:
    RewriteRule ^(aboutus|contact|home)$ page.php?p=$1 [L]
    RewriteRule ^(.*)$ profile.php?user=$1 [L]
    Good luck.
    Last edited by SaintsIan; 15-07-10 at 08:59 PM.

  5. #5
    Zzzz... billybombill is offline
    MemberRank
    Dec 2008 Join Date
    1,355Posts

    Re: [HELP] Make user profiles .htaccess?

    @Ian: i didnt think about that :O

    @m0nsta: you could use Malwarebytes if it lets you, ive used it for a few years ad works good (doesn't replace ant virus software but it scans well)

  6. #6
    Web Developer Markshall is offline
    MemberRank
    Oct 2009 Join Date
    EnglandLocation
    628Posts

    Re: [HELP] Make user profiles .htaccess?

    Thanks to you both :)

    I'll try your method out now Ian



Advertisement