Search code examples
testingwebfilezilla

How to set up a live test site?


This is probably really obvious to most of you but i am new to this.

How do you set up a live test site that does not use the primary domain name? At the moment the primary domain name is being used for a temporary landing page and I want that to be the case until the site goes live. I am using the filezilla.

The advice I had been given was to publish it to a sub folder or the htaccess file on the server so it can be configured to restrict access (e.g. by username and password) but I am not sure how to do that. Can you let me know the steps involved, bearing in mind I do not want a second domain but to test the site on a live server so others can see it but not using the primary domain.

Many thanks,


Solution

  • The simplest way is , as you said, to put the new site into an subfolder or you can create a new subdomain for that site. But if there is no need for that, i would prefer a simple subfolder in the folder the domain points to.

    I think it shouldn't be too tricky to create a subfolder and put the files in it, simple rightklick in filezilla and name it.

    For creating an htaccess password protection you need two files. One called .htacccess and the other .htpasswd (the point in front of the name is important).

    .htacces looks like:

    AuthType Basic
    AuthName "Hallo"
    AuthUserFile .htpasswd
    require valid-user  
    

    .htpasswd contains in each line one user with encrypted pw:

    username:1$3OVCsRyzKhk
    

    You'll find a lot of examples via google. Just type "htaccess htpasswd", and there will be also some generator which will help you.

    To enter your site, just type in browser: example.com/NewSubfolder/