Jump to content

Hide file name like Social Networks


BrendanMullan

Recommended Posts

Hi everone i am currently building a social network website, i have it mostly finished but one thing i am trying to do is instead of my members having the profile name of www.domain.com/ members.php?username=04836flfgkfifg84 for example,

 

i want it to be like twitter or facebook where it is like www.facebook.com/Brendan

 

Can someone help me out on doing this?

Link to comment
Share on other sites

Looking at a lot of the threads there i have tried a few ways and with no luck, i seen there is a way with php maybe, i have the username in the database that i want for the url so www.domain.com/username, anyone know a way i can grab the users username and replace the members.php?username=user with it?

Link to comment
Share on other sites

I have tried like this

 

RewriteEngine On
RewriteRule ^/(.+)$ /members.php?username=$1

 

does nothing


RewriteEngine on
RewriteBase /

RewriteRule ^([a-zA-Z0-9]+) members.php?username=$1

RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ $2.php?username=$1

 

takes out the members.php but stays on members page cant go anywhere else

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.