Category: htaccess
-
Redirect from an old domain with a subdirectory to a new domain without the subdirectory
In this example, we want to forward the entire sub directory from one domain name to another domain name without the sub directory. For example: From https://abc.byu.edu/subfolder/ To https://def.byu.edu We will use .htaccess to create the redirect. # enable mod_rewrote RewriteEngine On RewriteBase / # I try to use following…
-
Preventing video files being download by viewers
In this post, I will show how to use htaccess to protect video files being download from viewers. We only want viewers to view the files on web browser but we don’t want viewers to download them. Let’s say, we have video files, MP4, are stored in /var/www/folder1/folder2/folder3 and we…