Jump to content

[SOLVED] www.mysite.com/NewUser.


icon33

Recommended Posts

I am starting a site where users will be able create pages and the pages will need to be displayed when the URL reads

 

www.mysite.com/NewUser.

 

The pages are database driven and are created based on User IDs

 

I have not done this before and I'm looking for the best method to achieve this goal.

 

Similar to myspace.com/User or Blackplanet.com/User

 

thanx

Link to comment
https://forums.phpfreaks.com/topic/145169-solved-wwwmysitecomnewuser/
Share on other sites

just a note, doing it your way you would have to take the username, (unless they enter the id?) check your database to find the userid, and then run the rest of the page off that,

 

for this sort of thing i would suggest that you base your queries off there username. (assuming each username is unique)

but anyway the basic logic you need is

 

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^([0-9a-z_]+)$ index.php?username=$1 [NC]

 

which basically when a user types in eg mysite.com/john_doe

 

the server will load mysite.com/index.php?username=john_doe

Thanks and that work GREAT!!

 

- BUT -

 

Now i need to know how to get the rest of the variables to register...

 

http://www.e2minutesites.com/name will bring up the for the 'ID' that correlates with 'name'

 

but how do i get my links in the page to work correctly.

 

Site: http://www.e2minutesites.com/casana

 

i want my links to still use show the 'name' in the URL like above - but there are variables that follow to get different pages

 

http://www.e2minutesites.com/casana?additional_page=page_id    - HELP!

 

thnx again!

Got it all together:

 

Options +FollowSymLinks

 

RewriteEngine On

RewriteBase /

RewriteRule ^([0-9a-z_]+)/([0-9a-z_]+)$ members.php?url=$1&id=$2 [NC]

RewriteRule ^([0-9a-z_]+)/([0-9a-z_]+)/$ members.php?url=$1&id=$2 [NC]

RewriteRule ^([0-9a-z_]+)$ members.php?url=$1 [NC]

RewriteRule ^([0-9a-z_]+)/$ members.php?url=$1 [NC]

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.