Jump to content

[SOLVED] Registered User Paths


tpennetta

Recommended Posts

Hello Everybody,

 

I tried looking this up on the internet but do not think I am using the correct terminology for this problem. I am making blog-like system where new users that register can view their blogs by going to an address similar to:

 

http://www.website.com/username

 

Where username will change depending on the individual's username. I believe this has not only to do with PHP but with server setup (virtual directories or something) but i just wasnt sure. I am using Apache 2 web server if that is necessary to know in order to solve problem. Also I am using PHP5.

 

Any help on this topic is greatly appreciated.

 

Thanks in Advance!

Link to comment
https://forums.phpfreaks.com/topic/76274-solved-registered-user-paths/
Share on other sites

you will need to create a .htaccess file on your server in the web root

 

Like this.

 

 

RewriteEngine On
RewriteRule ^([A-Za-z0-9]+)$   blog.php?username=$1 [L]

 

with blog.php?username=

changed to your Environment settings

 

I coded the above as if the users are only allowed to use a alphanumeric username.

Let me know if you need it to include symbols also.

 

 

with blog.php?username=

changed to your Environment settings

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.