subdomain

PHP Getting Domain Name From Subdomain

I need to write a function to parse variables which contain domain names. It's best I explain this with an example, the variable could contain any of these things: here.example.com example.com example.org here.example.org But when passed through my function all of these must return either example.com or example.co.uk, the root domain ...

Is it possible to verify the domain that a cookie was set for using Rails integration tests?

I'm using the following technique to set a wild-card cookie for our domain: cookies['root_domain_flash_warning'] = { 'value' => 'mistakes have been made!', 'domain' => ".#{APP_DOMAIN}", 'expires' => 2.minutes.from_now } Which seems to work handily. Unfortunately I can't seem to look up anything but the value associated with the...

Dynamically add subdomains?

Hi all, I was wondering if it's possible to dynamically add subdomains that point to dynamic IP addresses, and how I would go about doing that? In other words, "how is dyndns/no-ip implemented" :-)? (The part I don't get is adding/changing the DNS entries... I understand how the client sends a packet every few minutes -___-). I can tell...

How many subdomains are appropriate?

I'm building a directory website and i want to represent each subdirectory as a subdomain on my website like: car.mydir.com and not mydir.com/car So the problem is the total number of subdirectory keywords are way too big. Do you think for example IIS can handle 40000 subdomains? ...

.htaccess to require WWW for domain, but allow subdomain if existing with no hard coding

Hello guys, I'm trying to figure it out how to set up an .htaccess set of rules that would force the presence of the "www" in front of the domain if it is not initially specified, but at the same time, it will not have any effect if the an subdomain is pressent; all this without hard coding any domain name so that the script is portable...

How to set default homepage for subdomain on iis7?

I've already set default homepage for "www.mydomain.com" sucessfully. Now, I want to set default homepage for "sub.mydomain.com", but it throw 404 page if i don't type "sub.mydomain.com/default.aspx" ? The first and the second site are separate physical folders and virtual directories on iis7. ...

Recommendation for handling RoR App with Subdomains

I'm currently evaluating options for adding sub-domain support to a new Ruby on Rails app and was wondering if there were any suggestions or experience that others could share. Some possible Choices SubDomain-Fu http://github.com/mbleigh/subdomain-fu/tree/master Rolling your own http://www.robbyonrails.com/articles/2009/01/11/subdo...

Google Analytics cookies vs subdomain for static content

Hello I have a website on www.example.com and use Google Analytics. I've also set up static.example.com which serves all static content. The problem is that the default behavior of GA is to issue cookies on ".example.com" but I don't want the static content traffic to be carrying the weight the GA cookies. I tried pageTracker._setDoma...

Creating subdomains dynamically for an application

I want to create subdomains dynamically through a PHP script or something similar. I've seen lots of sites that create subdomains for individual users, or for new forum spaces. I'm just wondering how that works, and how I can implement it in my system. Thanks for your help! ...

Rails: Routing subdomain to a resource

Is it possible to map a subdomain to a resource? I have a company model. Currently, using subdomain_fu, my routing file contains: map.company_root '', :controller => 'companies', :action => 'show', :conditions => { :subdomain => /.+/ } My Company model contains a "subdomain" column. Whilst this works as inten...

Rewrite subdomain to subdomain/folder in vhost situation

I'm trying to rewrite abc.example.com/path to abc.example.com/index.php/abc/path using the following .htaccess: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(abc)\.example\.com RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/abc/$1 [L] The situation is: domain www.e...

Redirect dynamic subdomain to same subdomain with subpage. How?

Hello, I'm a little stuck in here. I need to get some help with this subdomain-situation. I need to redirect http://dynamicsubdomain.example.com/ to http://dynamicsubdomain.example.com/account/welcome.html. How do I do this? I tried several things but all without result. The main problem is that I can't fetch the entered dynamic subdom...

subdomain rewriting in ASP.NET?

How do i do this in .NET? http://why.does.my.head.asplode.net/ I want to do something like ytmnd where each url is a different user generated page. I might need something as simple as pointing to a directory so dirname.mysite.com will redirect to http_public/userGenContent/dirname/ ...

.htaccess + subdomain + redirect

Hello friends, Just wanted to know how we can redirect the subdomain to domain. I have two domain which in pointing to my rails application and a subdomain www.xyz.com www.xyz.info example.xyz.com Now when the user access www.xyz.info the example.xyz.com page should open up but the address bar should be www.xyz.info. So is it poss...

How to use mod_rewrite to map to a different domain and preserve the original

For example: www.example.com and subdomain.mydomain.com are on the same server. When I put example.com in the address bar, I want it to serve the pages from subdomain.mydomain.com, but still show as example.com in the browser. So, if the old URL was: subdomain.mydomain.com/this/stuff?is_cool=yes the new url would be www.example.co...

Communication between two subdomains. Zend Framework.

Hey all, I'm adding a bulletin board to my Zend-driven site, and am using an open source one called Phorum. While it would be theoretically possible to integrate Phorum into my Zend site, it's already self contained, and not designed to run through a controller. My solution was to make a sub-domain for Phorum, which worked quite well...

Get root DNS entry from php server; get domain name without www, ect...

How would one get the root DNS entry from $_SERVER['HTTP_HOST']? Input: example.co.uk www.example.com blog.example.com forum.example.co.uk Output: example.co.uk example.com example.com example.co.uk EDIT: Lookup list is very long ...

htaccess Redirect from subdomain to domain

I'm re-working a site and I'm attempting to move a forum from a subdomain (board.example.com) to the primary domain where the path will be example.com/index.php/forums/ I've set up my htaccess file like so: RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*).example.com RewriteRule ^(.*)$ http://www.example.com/index.php/forums/ [R=301...

Subdomains and Logins

If you multiple subdomains e.g.: sub1.domain_name.com sub2.domain_name.com Is there a way to have a user be able to log into both of these without issues and double login issue? The platform is Python, Django. ...

Subdomains and Folders

Just started a site and I have an /img directory on the main domain. I would like to set up a subdomain(where the file folder is just another one in the main directory) that is able to use the /img folder but it doesn't work. The /img and /subdomain folders are on the same level, so to display images in the main domain I type: <img src...