By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 664 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

How to redirect url just like in

P: 12
Hello Friends,

I want to create a blog for the user that register to my site(for example after that I want to redirect user to

That is just like in How can I perform this task is I did to create a subdomain for every user that register my site or just to create a page and redirect it thorug .htacces.

please if anybody can guide me to perform this task.

Dec 6 '07 #1
Share this Question
Share on Google+
2 Replies

Expert 5K+
P: 6,050
I think blogger may create subdomains for it; but then again they might just use htaccess

What im working on currently, is just something you're speaking of; something like myspace. ie. myspace/username

at first i thought the /username was an index page so like: /username/index.php, etc.

But turns out they use htaccess (more than likely)

You can do this by doing:
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine on
  2. RewriteRule ^member/([A-Za-z0-9_-]+)$ member/?user=$1 [L]
Using that code, when the user types in their profile page ( the appearance of the URL will remain as is, but the qualities will change.

The url will, in effect, be changed to

Therefore, you could then use $_GET['user'] to retrieve the username and query your database for it!

The user will never see member/?user=
just /member/user-name-page

Dec 6 '07 #2

Expert 5K+
P: 6,050
ooooops, double posted that by accident!
Dec 6 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.