Tuesday, February 19, 2019

Restricted access to a test website for Testing purpose with .htaccess ...

If you also need to create a restricted access to a subdomain on your website due to testing, you can follow these steps.

  • You can create a temporary subdomain. E.g. testSubDomain.MyWesbsite.com
  • You can make the website accessible only for your IP address by creating a file called .htaccess in the directory of the website ( if there isn't such a file already) and adding the following code inside:

    order deny,allow
    deny from all
    allow from  

    Simply replace with the IP address from which you will be accessing the website.

No comments: