Dynamic Subdomains
#1
Posted 15 March 2008 - 10:37 PM
So need it to do something like this:
username.site.com is actually www.site.com/profile.php?name=username
#2
Posted 15 March 2008 - 10:55 PM
#3
Posted 16 March 2008 - 11:29 AM
#4
Posted 16 March 2008 - 12:34 PM
Hip Hop Artist, on Mar 16 2008, 04:29 PM, said:
Alternatively you could try and learn something...you know what you want (dynamic/virtual subdomains) and you have just shown you know how to do it (by using .htaccess) so instead of getting people to do things for you take the initiative and search..
Edited by Matthew., 16 March 2008 - 12:34 PM.
#5
Posted 16 March 2008 - 12:43 PM
Hip Hop Artist, on Mar 15 2008, 09:37 PM, said:
In the future, please try to be more polite, we're not here to ridicule people for not knowing how to use google.
#6
Posted 16 March 2008 - 12:54 PM
You might want to take a look at these two posts...seem pretty helpful.
http://www.webdevelo...ad.php?t=104901
http://forums.devarticles.com/advanced-web...main-24296.html
#7
Posted 16 March 2008 - 12:56 PM
Edited by Hip Hop Artist, 16 March 2008 - 01:19 PM.
#8
Posted 16 March 2008 - 02:49 PM
If the rewrite module was disabled on your server then I believe you get a 501 error shot back at you which makes me inclined to think that's not the problem, however I have read about wildcard DNS having to be enabled on the server on some of the sites I quickly looked at. Couldn't really guess any further than that, subdomains using this method is something I haven't actually done myself. Are you sure you are modifying the code right to work with your setup (e.g. the domain)?
Edited by Matthew., 16 March 2008 - 02:49 PM.
#9
Posted 16 March 2008 - 05:58 PM
#10
Posted 17 March 2008 - 12:14 AM
RewriteEngine On
# Extract the subdomain part of domain.com
RewriteCond %{HTTP_HOST} ^([^\.]+)\.domain\.tld$ [NC]
# Check that the subdomain part is not www and ftp and mail
RewriteCond %1 !^(www|ftp|mail)$ [NC]
# Redirect all requests to a php script passing as argument the subdomain
RewriteRule ^(.*)$ index.php?u=%1 [L]
There's what I came up with.
#11
Posted 17 March 2008 - 09:56 PM
still same error page...
Edited by Hip Hop Artist, 17 March 2008 - 10:08 PM.
#12
Posted 17 March 2008 - 10:14 PM
I found the following article explains what wildcard dns is quite well (at least to me).
http://en.wikipedia....card_DNS_record
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users
