Dynamic Subdomains

Status
Not open for further replies.

Spangoo

New Member
Hi All,

I am still getting my head round htaccess and am hoping that someone can help.

I want to set it up so that for example example.spangoo.com will load spangoo.com/?p=example.

I have tryed alot of different variations to try and get this to work and am getting no where ... is there any other server settings need changed so it will work???

code i have is

Code:
RewriteEngine on

RewriteCond %{HTTP_HOST} !^www\.spangoo\.com
RewriteCond %{HTTP_HOST} ([^.]+)\. spangoo\.com
RewriteRule ^(.*)$ index.php?p=%1

I am doing this on a Blacknight VPS running Debian
 

Spangoo

New Member
thats not very dynamic ... is * not a wildcard???

see i have confused myslef cause the way its sittin is as above and example.spangoo.com is workin but directing at the plesk no site at this address page rather than a 404, and the main spangoo.com is going nuts on a server error :(
 

Spangoo

New Member
yeh thats what i mean ... have done everything that they did and it is working i think, but the subdomain is still displaying the "no page defined" page :( ... would it have anything to do with the httpd.conf file?
 

louie

New Member
When I work with sub-domains I usually have the folder created and don't just go for the root index page.

If you setup the DNS as I told you above, you might need to wait a little while to propagate properly...
 

mneylon

Administrator
Staff member
The wildcard would be the way to do what you want, but if you're getting an error there's obviously something wrong.

As you're on a VPS you have full access to the server logs, so I'd recommend checking the apache error logs to see what it's logging as it throws the error
 

Spangoo

New Member
will have a look and see if i can find the apache log :)

thanks for the help guys, will post what i come up with if I can figure this out.

times like this i wish i had me a nice simple single hosting account, lol ... bloody servers :mad:
 
Status
Not open for further replies.
Top