Apache Redirect to Secure Link

If you have a directory that you want to force users into an SSL connection, the easiest way is to use a .htaccess file if your host allows it. The following will force any page to redirect to https:// if they aren’t on it already. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} If you want to exclude a directory or filename specifically, then just add in another rewrite condition as shown...

Read More

Forcing the Download Prompt for files

Sometimes you want to force a file to be downloaded instead of letting the browser decide how to handle it. For alot of servers, text files, for instance, will be displayed on the screen as a bland text page with no formatting. Instead you may want the download prompt to come up, have the user download the file, then have them continue on their way on your website. To accomplish this simply add an .htaccess file to the directory that the file...

Read More