Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 1121

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 1158

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 1162

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 1186

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 2855

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 2862

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php on line 2875

Warning: Cannot modify header information - headers already sent by (output started at /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php:1121) in /home/ser4rsi/public_html/wp-content/plugins/all-in-one-seo-pack/app/Common/Meta/Robots.php on line 87

Warning: Cannot modify header information - headers already sent by (output started at /home/ser4rsi/public_html/wp-content/plugins/gravityforms/common.php:1121) in /home/ser4rsi/public_html/wp-includes/feed-rss2.php on line 8
Htaccess | Server Sitters https://serversitters.com Leaders In Outsourced North American Web Hosting Support Mon, 28 Apr 2025 12:47:49 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.10 Add far future expiry header to your site https://serversitters.com/add-far-future-expiry-header-to-your-site.html?utm_source=rss&utm_medium=rss&utm_campaign=add-far-future-expiry-header-to-your-site Sat, 25 Jun 2016 12:50:15 +0000 http://serversitters.com/?p=1858 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, …

Read More

The post Add far future expiry header to your site first appeared on Server Sitters.

]]>
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, Weeks, Months, and Years.  You can set a default expires date, by using ExpiresDefault
For example “ExpiresDefault 1 month”  would set the default expiration of cache to be one month from now.

To add expires header to all of the images, Javascript, and CSS files, you can use the following code in a .htaccess file
<FilesMatch “\.(ico|jpg|gif|png|jpeg|js|css|swf)$”>
ExpiresDefault “access plus 2 weeks”
</FilesMatch>

The above code will cache the file types listed for 2 weeks before the browser will try to get new ones.

 

One thing to keep in mind with this however is that the browser will not check for updates until the cache expires.  So you’ll want to be careful with the file types you are setting this on, as well as how long you are setting it.  For example, if you have a .jpg file that you change every few days, then you should not set the expires headers to 2 weeks.  It should only be a day or 2.

 

You can specify individual files like this in a .htaccess

ExpiresActive On
ExpiresDefault A0
ExpiresByType image/jpg A604800

The default is set to 0 seconds, so everything would expire right away.  The jpg is set to 1 week.
A604800 is one week in seconds (60*60*24*7)
The “A” in the timestamp is required.  It means to expire from the date it was viewed.  Alternatively, you can swap the “A” for an “M”.  An “M” Means from the time the file was last modified.

The post Add far future expiry header to your site first appeared on Server Sitters.

]]>
A properly formated wordpress htaccess https://serversitters.com/a-properly-formated-wordpress-htaccess.html?utm_source=rss&utm_medium=rss&utm_campaign=a-properly-formated-wordpress-htaccess Sun, 22 May 2016 11:16:32 +0000 http://serversitters.com/?p=1838 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   …

Read More

The post A properly formated wordpress htaccess first appeared on Server Sitters.

]]>
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

 

 

The above is the default wordpress .htaccess file.  And should help to troubleshoot if anything in your own is wrong.

 

The post A properly formated wordpress htaccess first appeared on Server Sitters.

]]>
Force http to redirect to https via a .htaccess file https://serversitters.com/force-http-to-https-via-a-htaccess-file.html?utm_source=rss&utm_medium=rss&utm_campaign=force-http-to-https-via-a-htaccess-file Tue, 17 Nov 2015 15:38:44 +0000 http://serversitters.com/?p=1617 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 …

Read More

The post Force http to redirect to https via a .htaccess file first appeared on Server Sitters.

]]>
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 [R,L]

If the site is not loaded on port 443, then rewrite to the url to https:

RewriteEngine On
RewriteCondition %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

If the site is loaded on port 80, then rewrite the url to https:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

The post Force http to redirect to https via a .htaccess file first appeared on Server Sitters.

]]>
Unexpected T_STRING in an Apple iWeb site. https://serversitters.com/unexpected-t_string.html?utm_source=rss&utm_medium=rss&utm_campaign=unexpected-t_string Wed, 27 May 2015 16:17:54 +0000 http://serversitters.com/?p=1413 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 …

Read More

The post Unexpected T_STRING in an Apple iWeb site. first appeared on Server Sitters.

]]>
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 —
php_value short_open_tag 0

 

PHP.INI

Find the line that says short_open_tag in php.ini and turn it off

 

 

 

 

 

 

 

The post Unexpected T_STRING in an Apple iWeb site. first appeared on Server Sitters.

]]>
Manually re-install FrontPage Extensions https://serversitters.com/manually-re-install-frontpage-extensions.html?utm_source=rss&utm_medium=rss&utm_campaign=manually-re-install-frontpage-extensions Mon, 26 Jan 2015 17:28:07 +0000 http://serversitters.com/?p=1306 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 …

Read More

The post Manually re-install FrontPage Extensions first appeared on Server Sitters.

]]>
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
  • find ./ -iname '_*' -print0 | xargs -0 rm -Rf
  • find ./ -iname '.htaccess' | xargs rm -f
  • find ./ -iname '*.lck' | xargs rm -f
  • rm /usr/local/frontpage/$domainname.com*
  • rm /usr/local/frontpage/www.$domainname.com*

These commands delete all folders starting with an underscore (_), all .htaccess files, and all files with an extension of .lck.  It then deletes the server configuration files for frontpage itself for the domain.  Once these have been deleted, frontpage has been fully removed from the server.

To re-install frontpage, run this command.

  • /scripts/setupfp5 $domainname.com

Depending on the size of this site, this can take a few seconds, or several hours.  Once completed, the customer will need to re-publish the site and/or recalculate hyperlinks.

 

 

 

The post Manually re-install FrontPage Extensions first appeared on Server Sitters.

]]>
Apache Handlers https://serversitters.com/apache-handlers.html?utm_source=rss&utm_medium=rss&utm_campaign=apache-handlers Mon, 26 Jan 2015 17:17:06 +0000 http://serversitters.com/?p=1296 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 …

Read More

The post Apache Handlers first appeared on Server Sitters.

]]>
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
text/rtf rtf
application/xhtml+xml xhtml xht
application/vnd.ms-powerpoint ppt
application/x-csh csh
image/svg+xml svg
application/x-troff-ms ms
image/x-rgb rgb
application/x-img img
image/jpeg jpeg jpg jpe
image/x-portable-pixmap ppm
text/plain asc txt
image/cgm cgm
application/x-sh sh
application/andrew-inset ez
application/vnd.wap.wmlscriptc wmlsc
text/x-registry reg
video/vnd.mpegurl mxu
image/ief ief
audio/x-pn-realaudio ram rm
image/x-xpixmap xpm
video/mpeg mpeg mpg mpe
text/tab-separated-values tsv
application/rdf+xml rdf
application/x-httpd-php phtml php php3 php4 php5 php6
x-conference/x-cooltalk ice
image/tiff tiff tif
text/richtext rtx
text/css css
application/ruby rb
application/x-wais-source src
application/xml xml xsl
application/voicexml+xml vxml
image/x-portable-graymap pgm
chemical/x-xyz xyz
model/iges igs iges
application/vnd.mif mif
application/mathml+xml mathml
application/x-ustar ustar
application/x-troff-man man
text/vbscript vbs
text/calendar ics ifb
chemical/x-pdb pdb
application/smil smi smil
application/srgs+xml grxml
image/x-portable-anymap pnm
application/x-shockwave-flash swf
audio/mpeg mpga mp2 mp3
video/x-sgi-movie movie
application/cgi cgi
application/x-cpio cpio
application/x-javascript js
text/x-setext etx
audio/basic au snd
text/sgml sgml sgm
application/x-tar tgz tar
application/vnd.mozilla.xul+xml xul
application/x-futuresplash spl
application/xslt+xml xslt
model/mesh msh mesh silo
application/mac-binhex40 hqx
text/vnd.wap.wml wml
image/x-cmu-raster ras
application/x-sv4cpio sv4cpio
audio/x-aiff aif aiff aifc
application/x-gtar gtar
audio/x-ms-wax wax
audio/x-ms-wma wma
image/x-xwindowdump xwd
application/x-cdlink vcd
application/msword doc
video/quicktime qt mov
application/x-bcpio bcpio
application/x-tex tex
text/x-config cnf conf
application/x-sv4crc sv4crc
application/x-dvi dvi
application/x-troff t tr roff
audio/x-mpegurl m3u
application/x-shar shar
audio/mp4 a-latm m4p m4a mp4
application/pdf pdf
application/mac-compactpro cpt
application/vnd.wap.wmlc wmlc
video/x-msvideo avi
application/ogg ogg
text/html html htm shtml
image/gif gif
audio/midi mid midi kar
application/x-pkcs7-crl crl
application/x-chess-pgn pgn
audio/x-pn-realaudio-plugin rpm
application/srgs gram
application/x-koan skp skd skt skm
image/vnd.wap.wbmp wbmp
application/x-netcdf nc cdf
model/vrml wrl vrml
application/x-httpd-php-source phps
application/vnd.ms-excel xls
application/postscript ai eps ps
application/x-texinfo texinfo texi
application/zip zip
image/x-portable-bitmap pbm
audio/x-wav wav
application/x-x509-ca-cert crt
application/oda oda
application/xml-dtd dtd
application/octet-stream bin dms lha lzh exe class so dll iso dmg
text/vnd.wap.wmlscript wmls
application/x-stuffit sit

 

The post Apache Handlers first appeared on Server Sitters.

]]>
Limit access to website based on referrer https://serversitters.com/limit-access-to-website-based-on-referrer.html?utm_source=rss&utm_medium=rss&utm_campaign=limit-access-to-website-based-on-referrer Wed, 29 Aug 2012 05:14:48 +0000 http://serversitters.com/?p=666 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 …

Read More

The post Limit access to website based on referrer first appeared on Server Sitters.

]]>
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 access
}
else {
$domain=$_SERVER[“HTTP_REFERER”];
$domainref = parse_url($domain, PHP_URL_HOST);
//check to see what the referrer is
if ($domainref==”$validreferdomain”){
//start session and allow access
$_SESSION[‘allowme’] = 1; // store session data
}

//block access bad referrer and no session
else{
print “Access Forbidden. Please visit this page for further information.”;
exit;
}

}
?>

On this script you have to set $validreferdomain = to the referrer you want the visitor to come from.

Limitation – this only effects php pages and not images or other file types. You can get it to lock down html pages by setting the site to parse html as php.

The post Limit access to website based on referrer first appeared on Server Sitters.

]]>
Disable directory indexing https://serversitters.com/disable-directory-indexing.html?utm_source=rss&utm_medium=rss&utm_campaign=disable-directory-indexing Tue, 22 Dec 2009 21:45:57 +0000 http://serversitters.com/technical/?p=145 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

The post Disable directory indexing first appeared on Server Sitters.

]]>
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

The post Disable directory indexing first appeared on Server Sitters.

]]>
Disable Zend using a .htaccess file https://serversitters.com/disable-zend-using-a-htaccess-file.html?utm_source=rss&utm_medium=rss&utm_campaign=disable-zend-using-a-htaccess-file Fri, 18 Dec 2009 16:52:46 +0000 http://serversitters.com/technical/?p=67 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

The post Disable Zend using a .htaccess file first appeared on Server Sitters.

]]>
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

The post Disable Zend using a .htaccess file first appeared on Server Sitters.

]]>
Setting CGI to execute outside cgi-bin https://serversitters.com/setting-cgi-to-execute-outside-cgi-bin.html?utm_source=rss&utm_medium=rss&utm_campaign=setting-cgi-to-execute-outside-cgi-bin Thu, 17 Dec 2009 16:36:26 +0000 http://serversitters.com/technical/?p=62 The following line can be placed within a .htaccess file in the folder you wish to have CGI execution rights. Options +ExecCGI

The post Setting CGI to execute outside cgi-bin first appeared on Server Sitters.

]]>
The following line can be placed within a .htaccess file in the folder you wish to have CGI execution rights.

Options +ExecCGI

The post Setting CGI to execute outside cgi-bin first appeared on Server Sitters.

]]>