# Local File

The specified local file will be displayed without redirection (redirect) by executing it as a PHP script or by direct serving from the server. This method is the safest, and we strongly recommend using it wherever technically possible.

You can specify the file in several ways:

  • Absolute paths are considered relative to the root of the domain where the Cloakify PHP file is hosted. For example, if you specify the path /page/index.html and upload the Cloakify PHP file to https://example.com/safe/index.php , it will display the page https://example.com/page/index.html .
  • Relative paths are considered relative to the directory where the Cloakify PHP file is uploaded. For example, if you specify the path page/index.html and upload the Cloakify PHP file to https://example.com/safe/index.php , it will display the page https://example.com/safe/page/index.html .
  • Links can also be specified. In this case, the domain part will be removed. For example, you can specify the link https://site.com/page.html , and Cloakify will access the path /page.html on your actual domain, where the Cloakify PHP file is hosted.

Usually, you specify the path to an HTML page or a PHP script file. In this case, it's highly recommended to place the filtering Cloakify PHP file in the same directory. If you specify a subdirectory in the path, it will break all relative links on the final page because the visitor's browser won't know about the subdirectory in these paths - there's no redirect through which it could learn about it.

You can specify the path to a local directory without specifying a specific file within it. In this case, Cloakify will attempt to find and display an index.php , index.html , or index.htm file in that directory, checking for their existence in the specified order. This behavior is similar to how a web server looks for an index file when accessing a directory. However, this practice can lead to errors and is not recommended.

You can also specify the path to a non-HTML file. If the visitor's browser cannot display its content, it will download the file. For example, you can specify your content page as downloads/app.apk to "block" the downloading of an APK.

For JavaScript integration, this action will load the target page using synchronous XMLHttpRequest and replace its code with your white page's code without redirection. This will only work if the content and white page are on the same domain, or if the content page is served by a web server with properly configured Access-Control-Allow-Origin headers that allow cross-origin resource sharing (CORS).