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
https://forums.phpfreaks.com/topic/236273-hide-file-name-like-social-networks/
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?

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.