Category Archives: Htaccess
Add far future expiry header to your site
Adding far future expires headers will help to speed up your site by having cache last longer on the viewers web browser. It will not help the first time they load your site, but it will improve the loading speed every visit after that. You can set when cache expires by Seconds, Minutes, Hours, Days, …
A properly formated wordpress htaccess
If you suspect your .htaccess may be corrupt on your wordpress site, you can try backing up your .htaccess file, and then replace it with this. # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress …
Force http to redirect to https via a .htaccess file
There are many ways you can force visitors of your site to use https regards of what they type into their address bars. Here are a few ways you can do this from your .htaccess file If https is not on, then rewrite the url to https RewriteEngine On RewriteCond %{HTTPS} !^on$ RewriteRule (.*) https://yourdomain.com/$1 …
Unexpected T_STRING in an Apple iWeb site.
If you have a customer using Apple IWEB, you might come across an error that looks something like this: Parse error: syntax error, unexpected T_STRING in /home/username/public_html/index.html on line 1 To correct this, you need to turn short_open_tags off in PHP. Here are 2 ways to do this: .htaccess php_flag short_open_tag off — OR …
Manually re-install FrontPage Extensions
While virtually nobody supports frontpage anymore, this still comes in hand on older servers where customers refuse to believe that frontpage is buggy, insecure software. On a cPanel server, to reinstall frontpage extensions from the command line, do the following. *** Note this is destructive SSH to the server the customer is on. cd ~theirusername/public_html …
Apache Handlers
Apache handlers allow you to control how Apache manages certain files. If you want Apache to handle application/x-hdf hdf application/vnd.wap.wbxml wbxml image/x-xbitmap xbm image/x-icon ico image/vnd.djvu djvu djv application/x-troff-me me application/perl pl plx ppl perl pm application/x-tcl tcl image/bmp bmp text/x-sql sql image/png png text/x-log log audio/x-realaudio ra application/x-latex latex application/x-director dcr dir dxr …
Limit access to website based on referrer
We use suphp on this server and here was the solution. In the user’s public_html file we created a .htaccess with the following: SetEnv PHPRC /home/$user/public_html/php.ini Then a php.ini file with: auto_prepend_file = /home/$user/public_html/checkrefer.php checkrefer.php <?php session_start(); echo $_SESSION[‘allowme’]; //First we check to see if a valid session exists if ($_SESSION[‘allowme’]==1){ //keep going and allow …
Disable directory indexing
The easiest way to disable directory indexing is to update/create a .htaccess. Add the following to a .htaccess file within your primary web folder: Options -Indexes
Disable Zend using a .htaccess file
Some clients wish to disable zend on their site. This can be accomplished by creating a .htaccess file in their home folder with the following code: php_flag zend.ze1_compatibility_mode off
Setting CGI to execute outside cgi-bin
The following line can be placed within a .htaccess file in the folder you wish to have CGI execution rights. Options +ExecCGI
- English Support
- 24/7 x 365
- Branded Support
- Reduced Overhead
- Linux Experts
- Friendly Staff