I'm trying to make a website where the content changes slightly depending on who sent them there (but the site design and most of the content will stay the same). For instance, I have a group of people figuratively named:
John
Pete
Brian
And my website is www.website.com. Now, I'll store their individual data in a row in a mySQL table, and I want to pull their personal data from the table and insert it in the website when they send someone. My first question is, should I do this by creating subdomains or putting a variable in the url? The website is going to be a Word Press website, so I could have:
john.website.com
pete.website.com
brian.website.com
And just put the index.php file in the subdomain directory and Word Press would know that it's installation is in a different folder (the root folder) and work normally (I think). Then I could check the url of the website in php and grab the subdomain and use that in my query getting the personalized data.
Or, I could use variables in the url, like:
www.website.com/?person=john
www.website.com/?person=pete
www.website.com/?person=brian
And use GET to grab the person from the url and use that when querying the data.
There will also be more pages then just the homepage, such as www.website.com/my-hobbies. So for John the two methods would look like:
john.mywebsite.com/my-hobbies
and
www.website.com/my-hobbies/?person=john
Which would be better for SEO? I still would want the SEO to be best for the root website (i.e. www.website.com and it's child pages) and for it to show up in search results first.
Any thoughts?
Thanks for your advice!
|