473,320 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to redirect url just like in blogger.com

12
Hello Friends,

I want to create a blog for the user that register to my site(for example www.test.com) after that I want to redirect user to www.user.test.com.

That is just like in blogger.com. 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 www.user.test.com thorug .htacces.

please if anybody can guide me to perform this task.


Thanks.
Dec 6 '07 #1
2 4587
Markus
6,050 Expert 4TB
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]
  3.  
Using that code, when the user types in their profile page (yoursite.com/member/user-name-page) the appearance of the URL will remain as is, but the qualities will change.

The url yoursite.com/member/user-name-page will, in effect, be changed to yoursite.com/member/?user=user-name-page

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
Markus
6,050 Expert 4TB
ooooops, double posted that by accident!
Dec 6 '07 #3

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

Similar topics

0
by: mirnazim | last post by:
Hi, I am a PHP developper. I was thinking of writing a blogging software that would use public blogging services as www.blogger.com to store the data. But before embarking on to do so I would...
2
by: Ergobob | last post by:
Hello, I have a blog and RSS Feed running through Blogger and FeedBurner, respectively. I use the BlogIt button on the Google toolbar to post new items to the blog. If I create a second blog...
2
by: Pete.Cloth | last post by:
Can someone please help me with this. I need to align a picture onto a "blogger"? HELP!
1
by: Tarik Monem | last post by:
Here's the code for the index.xml file on the blogger <?xml version="1.0" encoding="<$MTPublishCharset$>"?> <rss version="2.0"> <channel> <title><$MTBlogName remove_html="1"...
1
by: JaceyBlue | last post by:
Hi, I am using a Blogger template and I modified the colors and that's it. You can View Source Code here: http://vipgossip.blogspot.com I'd like to change the black background to this image...
0
by: Paddy | last post by:
I got tired of Bloggers inadequate comment editor so wrote this for transforming code snippets: ========================= ''' blogspace.py Turns leading spaces into HTML &nbsp tokens which...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.