How to configure custom domain for links in Branch.io - ios

How do I set up the custom subdomain for my branch links? Currently I have pointed the cname records to xxxx.app.link and xxxx.test-app.link (I have added 2 CNAME records)
I get the following error when I try to add the sudomain in the dashboard – “Domain not properly configured; please CNAME your domain to ‘custom.bnc.lt’. If you’ve already done this, note that it can take up to several hours to propagate”
Do I have to point the subdoiman to “custom.bnc.lt” If yes, then how will the live and test environment urls be different? Do I have to setup 2 different CNAME records - one for the live version and one for the test version?
EDIT:
It has been several hours since I set up the CNAME records. A simple dig <my custom subdomain> gives the correct result.

Alex from Branch here: You should use custom.bnc.lt as the CNAME for your subdomain(s). The Live and Test environments can use the same URL or can be set separately — completely up to you, since our backend takes care of all the routing details. Our guide for this is here, which you might find useful for reference.

Related

How to buy a domain name starting with one.***.com

Recently many websites are hosted and have domain names of format (~~~.~~~.com) on URL's such as one.newrelic.com
Are these registered as ***.com and then one subdomain is added to create (~~~.~~~.com)
If not then how can i buy these or register?
Are these registered as ***.com and then one subdomain is added to create (~~~.~~~.com)
The short answer is yes. Here is the long answer,
This is a very fundamental question about how domains work. Don't think about the one part. That is the sub domain. You can create any subdomain you want under your primary domain name. You just have to buy the *.com domain.
Later you have to add an A type dns record to point one.*.com to your desired server.

Cloud Foundry Rails - Multi-tenancy based on subdomain

My rails application currently works as follows:
In the database, there are tenants, also known as 'companies'. Everything in the database belongs to one of these companies, and so have a company_id attribute in order to separate them.
My application determines which company to use based on the subdomain in the link inputted by the user, so for example:
apple.myapplicationsnamehere.com
Should look at the companies in my database, and find out which one is called "apple", then separate all of the data by apples ID.
This works fine on the localhost (if you're wondering how this is possible, I used a redirect to my localhost that I found online - http://apple.lvh.me:3000/)
However, this does not work on Cloud Foundry.
I have tried to use vmc's map function to create the Url: apple.myapplicationsnamehere.cloudfoundry.com, but this does not work, and simply appending a subdomain to my application doesn't work either.
Does anyone know of any way around this? Or perhaps I'm missing something? The database was seeded with caldecott already, so the companies certainly exist in the database.
You should be able to run a:
vmc map myapplicationnamehere apple.myapplicationsnamehere.com
vmc map myapplicationnamehere orange.myapplicationsnamehere.com
vmc map myapplicationnamehere pear.myapplicationsnamehere.com
Though i don't believe you can setup a wildcard match, so you'll need to run a vmc command each time a new company is added into your environment.

Is there a way to enforce strict url interpretation from a certain folder down?

An area of my site has a folder (let's call it "test") with a series of sub folders having unique names, based on a six digit code. I want any incorrect queries to that folder that are only one character different from an existing url to always return a 404 error, rather than redirecting to the very similar existing url, as it does presently.
EG: if .../test/abc001/sample.txt exists, and .../test/abc002/sample.txt doesn't, I need the second query to return a 404 rather than a redirect to the first url.
Can this be done in an .htaccess file?
This directive
Options -MultiViews
should turn off the behaviour you describe.
Background here (search for the "Multiviews" section) and reference on the Options directive here.
An upvote goes to Pekka but I can't really accept his answer as the correct one because, in my case at least, it wasn't. As I commented under his solution, the correct answer was provided by my hosting company who instructed me to use this directive:
CheckSpelling off
That is not to say that Pekka's answer won't be correct for other users facing a similar problem. The Apache reference for mod_speling states that CheckSpelling is off by default, so my hosting company are clearly overriding that default in the first place.
Anyway, thanks to those who tried to help.

Create a "playable demo" version of a Rails site?

It's quite common in sites- you have a "demo" version with a guest account full of data/posts/comments that you can play with, and all the data is reset every few hours so users wont spam the demo site.
I thought to have another rails environment, "mysite_demo" and use a cron job to call rake to reset it's database every X hours, and populate the seed data.
Then it hit me that all over my app I'll have to check if I'm running in "demo-mode":
For example, if the demo site has a login/register page too, a user might register, insert some data and wonder why his account is deleted after he logged in again.. so demosite shouldn't have a register option at all.
So I thought I'll make a "demo" branch of the code.. with the difference and just merge changes as I go... sounds like an overkill.
ideas?
In my application I started with a fixed demo user with an account that resets every hour. Something about that model didn't quite sit right - if there were multiple users hitting the demo at the same time you could get into some weird concurrency issues. And what if a user is in the middle of a demo and your reset the demo account? What happens?
I don't know if this model works for you but I ended up creating a brand new user account with a demo flag set in the database - I also automatically log the user in. This way the user gets to play around for as long as they like and I don't have to worry about data getting deleted/changed while a user demos my app. I run a cron job every night that deletes users with the demo flag set that are older than 24 hours.
If the demo version is running from its own database, how is it any different from the real thing? The demo site is just an instance of your product.
Just clean up the DB and redeploy the demo as needed. Is it just this simple or am I missing something?
Then it hit me that all over my app I'll have to check if I'm running in "demo-mode" (e.g, you cant register a new user in the demo) and make the site behave accordingly.
If the site is in demo, why does it matter what the users do? Anything they do will be wiped in a few hours, so they won't be able to actually do work with it.
It sounds like you are trying to handicap the site so they will pay. I don't know what your site does, but if its a host based service(web page that stores & display information) then the limited life span of the data should deter squatters.
If you website does something that can be used elsewhere, then I can see limiting it. An example might be a service that transforms media formats, or writes resumes. If the user can do something useful in the 2 hour window and walk away with it, then you might consider branching.
Why not allow the user to make an account even if it is deleted in an hour?
That allows them to see how the registration process of the script works for at least an hour, maybe give a message on the signup page that the account is only valid for an hour.
Just my thoughts
Is there any other functionality that is different in the demo version than the production environment? If it is just an issue of making the user register, you could just create a registered demo account in production, and give out the user name/password for people. Although this may not be an option depending on other business requirements.
If you are willing to use Authlogic you can take a look at this, then every X hours you can look through the database for users that start with anonymous_ and delete records that are associated with them.
Just make a separate demo site that works exactly like the production one, but the DB gets reset once an hour to clean example data. The only change you need to make is a banner across the top of every page that says its a demo. There are several ways to do it, (modify your site theme, or maybe use frames) but basically you should only have to change the code in one place, instead of throughout the site.
You could setup a new environment demo on your database.yml, with read-only privileges for the User table, and an additional demo_database. Then place some checks on your code to see if your RAILS_ENV is on DEMO.
That way, you only need to work with the same codebase and just show whatever you feel like it.
You can deploy it as a separate app with its own database to a separate domain or subdomain and then check the domain to decide what options should be available. For instance if you put it on demo.example.com you would use:
if request.domain =~ /demo/
If you use Capistrano you can set it up to update both apps when you deploy so they are in sync.

Serving different pages as different Domain Names in IIS (6 or 7)

I have a ASP.Net MVC application which serves user pages with URL like -
www.myapp.com/user/rob/index,
www.myapp.com/user/rob/article/1
and
www.myapp.com/user/scott/index,
www.myapp.com/user/scott/article/1
now I want this one application to serve pages to two different domains from outside. Like -
www.RobWebSite.com/Index
www.RobWebSite.com/article/1
www.scottBlogSiteNoOne.com/Index
www.ScottBlogSiteNoOne.com/article/1
what kind of setup / redirects / proxies I will need to setup so when user types the published domain name (www.RobWebSite.com) it translates internally to my app as (www.myapp.com/user/rob/). I want to keep the url in the browser the same what they typed, while just query string parameters changes.
Thanks and Regards,
Ajay
Each users' domain name will need a CNAME record in their DNS that points to myapp.com. (Google uses CNAME records to point custom domain names to Blogger.com blogs, so that seems like a good way to go.)
Then your code needs to look at the Request object to identify which domain name is being used and do a lookup to find which user the domain belongs to. This wouldn't really be translating to myapp.com/user/name/. It would be using the domain name to determine the user instead of the route parsing that you would normally do with MVC.
I'm not 100% sure that the Request object will give you the right domain name. You'll have to try it out.
You could also just setup your code so that your urls specify relative paths rather than absolute URLs. This will keep the domain name the same in the browser and improve performance.

Resources