TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-17-2009, 10:30 AM   #1 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default Domain mapping

Does anybody know how sites like wordpress.org let users add their own domains to their blogs.

So for example I could add my domain myblog.com and it would point to myblog.wordpress.org.

I'm not even sure it's done with PHP but if somebody could point me in the right direction it would be great
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 02-18-2009, 12:35 AM   #2 (permalink)
The Acquainted
 
buildakicker's Avatar
 
Join Date: Jan 2008
Posts: 119
Thanks: 21
buildakicker is on a distinguished road
Default

Use mod_rewrite. You can easily create subdirectories with php.

I found this, please post what you come up with!
__________________
SkiLeases.com
buildakicker is offline  
Reply With Quote
Old 02-18-2009, 09:25 AM   #3 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Creating the subdomain isn't my problem, I have that working already.

I want users to have the option to use a top level domain if they want.
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 02-18-2009, 02:42 PM   #4 (permalink)
The Contributor
 
Join Date: Jan 2009
Posts: 40
Thanks: 10
Scottymeuk is on a distinguished road
Default

Then you are going to start getting into DNS setting etc. You best bet is just to have an external url box and if thats set and valid then redirect to that. But if you want them to have it hosted on yours still then your going to have to be able to change DNS settings etc. Like putting the subdomain into there cname setting etc. Going to be quite hard to do.
Scottymeuk is offline  
Reply With Quote
Old 02-18-2009, 04:06 PM   #5 (permalink)
Jmz
The Acquainted
 
Join Date: Oct 2007
Location: Newcastle, UK
Posts: 113
Thanks: 3
Jmz is on a distinguished road
Default

Really at the minute I just want to get a basic idea of how it would work. Then I can have a look at it once the rest of my site is finished.

Even if I end up paying someone else to do it I dont mind. I just want to get a vague idea of what is involved for it to be done.
__________________
Free CSS Tutorials
Send a message via MSN to Jmz
Jmz is offline  
Reply With Quote
Old 02-21-2009, 08:37 PM   #6 (permalink)
The Wanderer
 
Join Date: Nov 2007
Posts: 13
Thanks: 0
trmbne2000 is on a distinguished road
Default

All of their subdomains like username.wordpress.com are probably handled with wildcard dns (http://en.wikipedia.org/wiki/Wildcard_DNS_record). As far as being able to get www.username.com to map to your wordpress site, I don't know exactly what they do, but this solution may work as a workaround:

Use mod_rewrite to serve master.php in place of all html files, something like this:
Code:
RewriteEngine on
# Skip www.yourdomain.com
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule \.(css|jpe?g|gif|png)$ - [L]
RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
RewriteRule ^www.([\w\.-]+\.[\w]{2,3})/(.*) master.php?domain=$1&args=$2
Then in master.php you would need to have some code to pull out the domain and other arguments passed in the rewritten url.

Hope that gets you started in the right direction.
trmbne2000 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
setup sub domain on wamp? sarmenhb General 3 06-25-2011 04:09 AM
Domain ideas for my project oscargodson The Lounge 3 09-05-2008 07:27 PM
how to query the availability of a domain? sarmenhb Absolute Beginners 1 06-25-2008 11:30 PM
Email form - validates email by checking a/mx records of domain. Sam Granger Script Giveaway 4 03-30-2008 05:58 PM
Domain Keyword Haris Absolute Beginners 8 11-26-2007 05:13 AM


All times are GMT. The time now is 06:24 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design