Heroku + node.js: I have a server which uses multiple ports. How can I get Heroku to allocate them?

Okay, after doing some research I’ve found out that opening ports in Heroku is disabled and not allowed. The only way around this is to use sub-domains and then in-app to use a proxy module (like subdomain-router which I use). BUT – Heroku don’t let you create sub-domains on their domain, meaning that your-app.herokuapp.com is … Read more

.htaccess – Redirect subdomain to folder

Add this to your .htaccess in your web root / directory RewriteEngine on RewriteBase / RewriteCond %{HTTP_HOST} ^m\.daltonempire\.nl$ [NC] RewriteCond %{REQUEST_URI} !^/m(/|$) [NC] RewriteCond %{REQUEST_FILENAME} !-d # not a dir RewriteCond %{REQUEST_FILENAME} !-f # not a file RewriteRule ^(.*)$ m/$1 [L] The %{REQUEST_FILENAME} conditions would let you access /exists.php and not rewrite it to /m/exists.php. … Read more

AJAX, Subdomains, and SSL

With plain-http AJAX: You are talking about doing cross-domain XMLHttpRequest, which is not permitted by browsers. There’s a W3C proposal pending to implement this in a secure way in the future (partially implemented by IE8, IIRC), but it’s definitely not possible at present. There are, however, workarounds for doing it securely: Subspace (which uses iframes … Read more

Apache rewrite based on subdomain

You should have a look at the URL Rewriting Guide from the apache documentation. The following is untested, but it should to the trick: RewriteCond %{HTTP_HOST} ^([^.]+)\.blah\.domain\.com$ RewriteRule ^/(.*)$ http://blah.domain.com/%1/$1 [L,R] This only works if the subdomain contains no dots. Otherwise, you’d have to alter the Regexp in RewriteCond to match any character which should … Read more

What does Rails 3 session_store domain :all really do?

OK, the way to accomplish this is to set the domain on the session cookie dynamically. To do this early enough it should be done as rack middleware: # Custom Domain Cookie # # Set the cookie domain to the custom domain if it’s present class CustomDomainCookie def initialize(app, default_domain) @app = app @default_domain = … Read more

When should one use a ‘www’ subdomain?

There are a ton of good reasons to include it, the best of which is here: Yahoo Performance Best Practices Due to the dot rule with cookies, if you don’t have the ‘www.’ then you can’t set two-dot cookies or cross-subdomain cookies a la *.example.com. There are two pertinent impacts. First it means that any … Read more

techhipbettruvabetnorabahisbahis forumu