Jump to content

Dynamic subdomains?


Voldemort

Recommended Posts

I've been trying to create dynamic subdomains with htaccess but I've had no luck.

 

I'm trying to make http://whatever.mysite.com redirect to http://www.mysite.com/index.php?name=whatever...

 

RewriteEngine On
RewriteCond %{HTTP_HOST} ^([^\.]+)\.mysite\.com$ [NC]
RewriteCond %1 !^(www|ftp|mail)$ [NC]
RewriteRule ^.*$ http://www.mysite.com/index.php?name=%1 [R,L]

Link to comment
Share on other sites

Do you have wildcard subdomains enabled?  If you don't then that could be [part of] the problem....

 

As for your rewrite... hmmm... I think it's ok, but I'm terrible at that stuff...

 

If you ping randomsubdomain.yoursite.com does it know which IP to ping?

Link to comment
Share on other sites

Last night my hosting company said they enabled it, but It doesn't seem like it is...

 

Everything I read says I should get a "page not found" error, but I'm still getting a "site doesn't exist" error. I've sent another request, but that was two minutes ago, so I won't know for a while.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.