Display a different URL for a subdomain - html

I've developed an application that a client might access at a URL like this: http://example.com. In this case, I own and control http://example.com.
I now have a case where another company would like present my application as their own by changing some of the branding and the URL (say: http://companyx.com). The application and all the data will still remain hosed with me just like it was at http://example.com.
What's the best way to handle this? I was going to create a separate directory for this company so I can update the branding (mainly just a logo) to make it specific to them, but I'm not sure how I can make this directory accessible to people going to a directory on the company site (http://companyx.com). Using sub-domains is also an option if this makes it easier. Assume that I'll be able to add records to companyx.com's DNS, etc.

You need to create a separate directory, then create a subdomain at sub.example.com and point it to directory (you can do this from your hosting control panel). Now your company needs to point their desired url (within their domain) to your subdomain.
IMHO this is the cleanest solution, if you need to have control over the site's content.
edit
what company needs to do is to point cname record of domain to your url and it should work, (otherwise you will need to get separate ip for your subdomain in order to point A record there)

Related

How to disable parent directory access in web file browsing without web server

I am writing a command line application that produces an index.html with links to other generated HTML files, but also some links to filesystem subdirectories. Here is an example of such a link:
Invoices
The intention for sharing this content is for the user to zip up the directory tree and send it to other parties for review. However, some users might think to use ngrok, or use screen sharing, to share their web browser to allow other people to access their local system. With ngrok they would be running a web server and might be able to configure the web server to protect against this, but with screen sharing that would not be possible. (Consider the case where a user might leave their web browser open to the remote user and step away, not realizing that the remote user can now examine their entire filesystem.)
The problem is the "Parent Directory" links. Using those links, the others could navigate above the intended directory root and navigate their entire filesystem. Here is an image to illustrate:
The directories linked to can have arbitrary numbers and levels of subdirectories, so hard-coding links on custom pages would probably be prohibitively complicated.
There is no web server involved here; the files are displayed by just opening index.html in a web browser, so .htaccess is not a solution. Also, I don't want to disable navigation, I only want to limit its upper bound.
Is there a way to prevent this access?
If there is no web server involved at all, there is no way to prevent that behaviour.
Edit:
You could of course write a browser plugin that limits the access to the parent directory using JavaScript. But every client would have to install that plugin.

A good practice to set my custom domains on Heroku

Basically, Heroku gives you a domain named by default: XXX.herokuapp.com.
On my own, I have a set of REST apis that I would like to set on a domain named: api.myDomain.com.
On the same time, I have my HTML files (web view) distributed by the same server as the REST API.
It's similar to this; embedding static files on server in a dist folder.
I expect the domain serving those HTML/JS files to be www.myDomain.com.
I thought about putting them clearly on a distinct server dedicated to static files, but the fact is that Single Page Application should be controlled by a server, in order to make the refresh works (F5 redirecting to index.html), that's why I chose to use the same server as REST apis.
An alternative would be to dedicate ANOTHER server to treat only static files, independent of the REST Apis' server.
How to deal with both domains (api and www) while sources being on the same servers?
Or should I completely rethink the strategy?
You can just set both domains to direct to your page by setting it up in your app settings, but then I'm pretty sure that would mean api.myDomain.com/dist would show your static things, and www.myDomain.com could show your api things.
https://devcenter.heroku.com/articles/custom-domains
Another way you could do this might be by doing some things with your actual code, but we don't really know what your code is like right now.

Have WorldPay test our integration without customers seeing the site?

Basically, we have a site and a store already setup (not using WorldPay), but we’re changing to an entirely new website design, with a new store, using WorldPay this time (but using the same domain name as before).
Everything is all tested and ready on a temporary URL, so all that is left to do is have WorldPay activated and switch the domain over, but how can we give WorldPay access to test and activate our installation WITHOUT letting customers see the site at the same time (as we want to launch it on a set time/date).
The options from our perspective were:
WorldPay tell us the IP address they will be checking over the installation with, and we can limit access by IP address using htaccess or similar.
We change the URL temporarily to something like “/store38382882” which no one will know about, then once everything is activated, we would need to switch back to just “/store”. But from what I can see in the WorldPay docs, the URL you provide them with isn't easily changeable.
Are either of these possible? And if not, how is this usually handled? Just hoping for advice from people who've done this before!
I put site on a sub domain, in the worldpay admin area, you set the callback URL and passphase specific for the sub domain.
Once you are ready for live, you just need to make sure that your settings also match up with the live configuration of your account on worldpay
for example:
live callback http://www.site.com/worldpay/callback
Testing and demo http://test.site.com/worldpay/callback
You should have bindings in your code to detect the Host URL to pick up if its www. or test. this will enable you to have settings for live and test without having to do many changes to your code, or worse, having two versions of the code base.
hope this helps

How do I create a website using HTML?

I have recently learned how to write HTML pages on a standalone computer, with all the references given to the directories in the local drives.
How, then, can I do the following:
Create a website, using HTML. I know I'll be able to create its look, but I don't know what should be given as the reference address (URL) if there is a hyper link (like: href). So how do I get an address that can be used on the Internet?
How do I upload this file to the Internet, do I have to upload it onto a server? If yes, which?
If there are multiple pages then how do I create references between?
Most importantly if I have to create this site should I use HTML, or something else?
When developing a website you will want to observe the following:
You need to regsiter a domain name that you want people to use to access your site. You can do this using any number of online registrars
You will have to get a web host...again there are many. They will give you instructions to upload using FTP or otherwise
The references between pages on your website will have to use relative addresses. That is /page2.html rather than http://www.myserver.com/page2.html.
You have to use HTML to create the front end. Plus CSS and maybe JavaScript. If you need dynamic content like accessing a database etc then you have to learn server side languages like PHP, ASP.NET or JSP.
To reference pages and resources (images, css, et.c.) you can use either relative paths, virtual paths or absolute paths.
A relative path shows the relation between the items, for example:
An image in the same folder: art.gif
An image in a subfolder: images/art.gif
An image in a parent folder: ../art.gif
An image in a parallel subfolder: ../images/art.gif
A virtual path starts with "/", so it's relative to the root folder of the site:
An image in the root folder: /art.gif
An image in a subfolder: /images/art.gif
An absolute path specifies the complete URL to the resource:
An image in a subfolder: http://www.mysite.com/images/art.gif
To put the pages on the net, you need some kind of hosting. You can start with searching the web for "free hosting" and you will find plenty of sites where you can try this out.
Most free hosting offer a subdomain or subfolder for your site, like mypage.thewebhost.com or www.thewebhost.com/mypage. If you want your own domain like www.mypage.com you need to register it for a fee. Many hosts offer a domain name "for free" when you buy web space, but you will of course end up paying for it in the end as it's included in the fee for the space.
Regardless of how you create the page, it will use HTML in the end. That's what the web is made of. If you use a server side language like ASP.NET or PHP, they still output HTML pages for the browser.
This is a great site if you're just getting started with HTML: http://www.w3schools.com/
I think you are asking about how to publish your site on the web and then access it.
Buy a domain, go to any domain hosting site like godaddy.com etc.
After buying domain the domain hosting company will send you the details of your account/pwd
With you account pwd you can access their ftp server.
Put your current html pages on their ftp server (put them in the public folder)
Access your html pages on the web now.
Also note it will take atleast a few minutes before your domain info gets published on the dns servers, i.e to say it will take a while before you can access your website (usually a few minutes)
Try giving relative urls in the href link. For e.g. if you want to link index.html to page1.html in the same folder you don't need to give complete path of the page1.html for the link. You can simply write Page 1
You can learn more about relative urls from here
You can get a free web hosting account from sites like http://110mb.com , they also provide a free sub-domain and a ftp account.
You need HTML to create webpages. There's no other option.
Hope this helps.
Google is your friend. There's tons of help for web site development. I just recently switiched from HTML to PHP, but I recommend you use HTML until you are fully comfortable with it.

How do I move a site from one url to another?

I have an ASP.NET web application hosted on DiscountASP.NET with its domain name registered on GoDaddy. This site is working perfectly and runs great, but I hate the domain name.
So now, I decide to purchase a domain name I like better. How do I set it up so that this domain name runs the same web app as my original application, but using the new domain name instead of the old one (i.e. I don't want to redirect to the old url, I want everything to work under the new url)?
This should be quite simple. Go to the host/registrar of your new domain and point it to the same ip addresses that the godaddy url points to.
You can have the old url and new url coexist. The DNS servers just map to the the physical IP your app is hosted on.
If you've been naughty and use absolute urls/directories in your app, you will have to rewrite some code. All the while reciting the mantra... that's why I should have used relative references...
Either move the application files over and create a redirect from the old URL to the new, or set up a rewrite under the new URL to transparently pass requests to the existing one.