subdomain

.htaccess rules with a second domain to use a different directory than root?

Domain1 uses root / I am trying to have Domain2 use /domain2 When I visit domain2.com, I want it to appear as domain2.com and use the files from /domain2 instead of root / The closest I got was: RewriteEngine on RewriteCond %{HTTP_HOST} ^domain2\.com$ [NC] RewriteRule ^/?$ /domain2/$1 [L] But if I try to go to some page at doma...

mod_rewrite rule to use the CSS from root web folder in a subdomain

My root already has all the css and image files I require www.example.com (my domain) www.example.com/css/style.css (my styles) On my hosting, my sub domain has to live inside a folder root folder public_html/ index.php css/ style.php subdomains/ admin/ .htaccess index.php How can I use mod...

PHP - same server, different domains require different sessions.

Hello, I'm implementing login and registration for multiple domains that talk to a single database - we'll call them i.domain-a.com and i.domain-b.com. Both these subdomains have A records in the DNS that point to a single server - thus making i.domain-a.com/hello.php and i.domain-b.com/hello.php run the same thing. So, if I create a s...

Changing MySQL Record value for Rails App Subdomain

I'm not sure if I'm able to describe this clearly but I'm going to give it a shot...I've painted myself into a bit of a corner. Obviously there's a bug in my code, so pls pardon the newbie question... My Rails app uses subdomains like this... UserAccount1.theapp.com - Primary user UserAccount1.theapp.com - Secondary user UserAccount2...

I want to use a controller with an expected nil; how do I handle this?

I have created a site which utilizes subdomains and searches whether or not the user is at: subdomain.domain.com or domain.com. If the user is in subdomain.domain.com, /views/layouts/application.html.erb appears, if the user is in domain.com /views/layouts/promo_site.html.erb appears. To accomplish this I closely followed Robby on Rails ...

Help with complex nginx rewrite rules for subdomains needed please

I currently have the following (hacky) re-write rule in my nginx.conf to allow dynamic sub-domains to be re-directed to one Django instance. set $subdomain ""; set $subdomain_root ""; set $doit ""; if ($host ~* "^(.+)\.domain\.com$") { set $subdomain $1; set $subdomain_root "/profile/$subdomain"; set $doit TR; } if (!-f $req...

Virtualmin - Domain / Subdomain confusion

Hi, I've just purchased a new VPS and setup Virtualmin on it. I pointed my domain at the IP of the server and set up a new virtual server through Virtualmin. I uploaded a simple php script to check it was working and it seemed to be fine. I then created a subserver and also pointed test.mydomain.com to my IP, with the intension of ha...

Ruby on Rails user generated subdomains - do I need a Dedicated Virtual Host?

I'm successfully running subdomains on my mac OSX as outlined by Robby on Rails. I'd like to follow the example code below but I have no idea where to start. How do you edit a DNS setup? Do I need to have a dedicated virtual host to do this? Right now I have a standard (crappy) Dreamhost shared hosting. If I go with a DVH, is Media Templ...

How do I route by domain / subdomain in rails

I looked at subdomain-fu and it looks pretty easy to route all non-www and non-'' subdomain requests to a single controller. But I also, need to send all external domains that are CNAME'd to my domain to the same controller. I have done a lot of searching and I can't find anything. Summarized, if it is a subdomain on my domain it goes...

Asp.NET cookie across subdomains not updating and not expiring

I have 2 subdomains and I need to set and read the same cookie from both websites. When I use localhost, everything works fine. When I switch to using valid urls, the cookie infomation is not really being updated when I update it (expire date on logout). I have the domain of the cookie set to ".mysite.com" what is wrong? ...

Should I delete the cgi-bin folder in a subdomain I just created?

Using cpanel on my hosting account, I created a subdomain - e.g. www.clothing.mysite.com A cgi-bin folder was automatically created in the directory for clothing.mysite.com. Do I need it? I'm only using the subdomain to install wordpress on it. I don't really understand what the cgi-bin folder is for and I'm happy to leave it if it d...

Wordpress & Vanity User URLs

Hi All, Was wondering if anyone had any smart approaches to creating dynamic vanity user urls upon user registration. My site basically uses emails as usernames. I have the regex to strip the text before the "@" symbol (e.g. "[email protected]" becomes "name") I would then like to take the "name" and create a vanity url (e.g. domain.com/na...

dynamic subdomains and struts2

Hello! I want to create dynamic subdomains on my site. I know how to create it using apache2 mod_rewrite (convert urls like sub.domain.com to domain.com/sub/). But I have one problem: I don't know how my web application learn about this subdomain. How I can do this using Struts2? ...

Django app on it's own subdomain

Did a few searches but couldn't find anything good about this problem. I've got the following setup. / (index), /blog/ and /about/. The way I do want it to be displayed, running only one Django instance is blog.domain.com (for my blog app) and all the other urls to run under (www.)domain.com/. I could surely hardcode the links, forcing...

Loading javascript in an iFrame on different subdomains

I have a javascript function that loads CKEditor in one of my iFrames. Problem is that my iFrame is located on a different subdomain. I fixed this by using document.domain, however my CKeditor only loads sometimes. Does anyone know how to solve this? ...

Python Boto S3 to work with Custom Domains in Amazon S3

How do I use the Python Boto library with S3 where the URL's it generate will be my CNAME'd subdomain to the Amazon S3 Server. By default it uses the default format BUCKETNAME.s3.amazonaws.com but S3 supports custom domain aliasing using CNAME (so you can have custom.domain.com -> CNAME -> custom.domain.com.s3.amazonaws.com where "cust...

Jquery External Link Help

I'm fairly new to jquery and haven't had much time to explore more and was wondering if anyone could help me. Here is the code I have which I pulled from different places: $("a").filter(function() { return this.hostname && this.hostname !== location.hostname; }) ...

Setting Access-Control-Allow-Origin in Dreamhost possible?

Just wanted a confirmation for this: Firefox currently doesn't play well for picking custom fonts through a sub-domain via the font-face tag. Other browsers do this without any problems. A little research showed up saying that i am required to set the Access-Control-Allow-Origin as is shown in the link here: http://pastie.org/653265 E...

Is it possible to limit outside connections to a subdomain with .htaccess or similar?

I host a web application. This application serves static html pages that are refreshed at various intervals. Some as often as every 30 secs. At this time I have about 300 unique pages that are accessed via 300 unique subdomains. Some clients have at most 50 visitors to their unique page and it refreshes every 30 secs, no problem. Other c...

Rails Subdomain Model-Based

Dears, In My Rails Project i'm using subdomain_fu for subdomain support. but i was looking for the Model-Based Subdomain support in subdomain_fu as in my application 2 models have subdomain fields. and i would like to route the application according to the subdomain specified as check the subdomain is related to which model and start r...