Category: How to: Manage Advanced Settings via .htaccess in SiteWorx

Share this post...Tweet about this on TwitterShare on Google+0Share on Facebook0

How to: Add a domain wide .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. If a domain wide .htaccess file does not already exist, you will see an  button. Click this button to add the .htaccess file.

How to: Add a directory specific .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Per Directory Options section.
  4. Choose the directory you want to create this .htaccess file in from the Directory drop-down menu.
  5. If you would like this new .htaccess file to be immediately enabled upon creation, choose “Enabled” from the Status section.
  6. Click the  button.

How to: Delete the domain wide .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. Click the  button.
  5. You will see a confirmation page. Click the  button to confirm.

How to: Delete a directory specific .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Per Directory Options section.
  4. Click the checkbox next to the directory or directories you want to delete the .htaccess file from.
  5. Using the drop down at the bottom of the list of directories, select “Delete …”.

How to: Enable a domain wide .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. If a domain wide .htaccess file is currently disabled, you will see an  button. Click this button to enable the .htaccess file.

How to: Enable a directory specific .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Per Directory Options section.
  4. Click the checkbox next to the directory or directories you want to enable the .htaccess file in.
  5. Using the drop down at the bottom of the list of directories, select “Enable”.

How to: Disable a domain wide .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. If a domain wide .htaccess file is currently enabled, you will see a button. Click this button to disable the .htaccess file.

How to: Disable a directory specific .htaccess file

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Per Directory Options section.
  4. Click the checkbox next to the directory or directories you want to disable the .htaccess file in.
  5. Using the drop down at the bottom of the list of directories, select “Disable”.

How to: Add / Edit .htaccess Access Control

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Access Control ] link for the directory you’d like to manage.
  4. Choose the Access Order. The choices are “Deny first, then allow”, and “Allow first, then deny”.
    • Deny first, then allow – The ‘Blocked Hosts’ list will be evaluated first.
    • Allow first, then deny – The ‘Trusted Hosts’ list will be evaluated first.
  5. Enter hosts or IP addresses on the Trusted Hosts and/or the Blocked Hosts text boxes.
  6. Click the  button.

How to: Add an Error Document

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Error Documents ] link for the directory you’d like to manage..
  4. In the “Error Code” column, select the error code from the dropdown list.
  5. In the “Error Page” column, enter the path to your custom error document, relative to the web root. Alternatively, you can enter a fully-qualified URL to another page.
  6. Click the  button.

How to: Edit an Error Document

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Error Documents ] link for the directory you’d like to manage..
  4. Click the [ Edit ] link next to the error document you would like to edit.
  5. In the “Error Code” column, select the error code from the dropdown list.
  6. In the “Error Page” column, enter the path to your custom error document, relative to the web root. Alternatively, you can enter a fully-qualified URL to another page.
  7. Click the  button.

How to: Delete an Error Document

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Error Documents ] link for the directory you’d like to manage..
  4. Mark the checkboxes for the error documents you wish to delete. You may also click the [ Check All ] link at the bottom of the list to quickly check all the error documents.
  5. In the dropdown labeled with selected:, choose the Delete… option.
  6. You will be asked to confirm the deletion of the error documents. Click the  button to finish.

How to: Add a MIME-Type

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ MIME-Types ] link for the directory you’d like to manage..
  4. In the “MIME-Type” column, enter the MIME-Type you would like to use for the given extensions. As you type, the field will auto-complete with various known MIME-Types. MIME-Types must be in the form: “<type>/<subtype>”.
  5. In the “Extensions” column, enter a space separated list of extensions.
  6. Click the  button.

How to: Edit a MIME-Type

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ MIME-Types ] link for the directory you’d like to manage.
  4. Click the [ Edit ] link next to the MIME-Type you would like to edit.
  5. In the “MIME-Type” column, enter the MIME-Type you would like to use for the given extensions. As you type, the field will auto-complete with various known MIME-Types. MIME-Types must be in the form: “<type>/<subtype>”.
  6. In the “Extensions” column, enter a space separated list of extensions.
  7. Click the  button.

How to: Delete a MIME-Type

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ MIME-Types ] link for the directory you’d like to manage.
  4. Mark the checkboxes for the MIME-Types you wish to delete. You may also click the [ Check All ] link at the bottom of the list to quickly check all the MIME-Types.
  5. In the dropdown labeled with selected:, choose the Delete… option.
  6. You will be asked to confirm the deletion of the MIME-Types. Click the  button to finish.

How to:  Add an Apache Handler

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Handlers ] link for the directory you’d like to manage..
  4. In the “Handler”column, enter the Apache handler you would like to use for the given extensions. As you type, the field will auto-complete with the various default handlers in Apache.
  5. In the “Extensions” column, enter a space separated list of extensions.
  6. Click the  button.

How to: Edit an Apache Handler

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Handlers ] link for the directory you’d like to manage.
  4. Click the [ Edit ] link next to the handler you would like to edit.
  5. In the “Handler” column, enter the Apache handler you would like to use for the given extensions. As you type, the field will auto-complete with the various default handlers in Apache.
  6. In the “Extensions” column, enter a space separated list of extensions.
  7. Click the  button.

How to: Delete an Apache Handler

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Handlers ] link for the directory you’d like to manage.
  4. Mark the checkboxes for the handlers you wish to delete. You may also click the [ Check All ] link at the bottom of the list to quickly check all the handlers.
  5. In the dropdown labeled with selected:, choose the Delete… option.
  6. You will be asked to confirm the deletion of the Apache handlers. Click the  button to finish.

How to: Set a Default Character Set

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Default Character Set ] link for the directory you’d like to manage.
  4. In the Default Character Set column, enter the default character set you’d like to use. As you type, the field will auto-complete with some of the more commonly used character sets.
  5. Click the  button.

How to: Edit a Default Character Set

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Default Character Set ] link for the directory you’d like to manage.
  4. Click the  button next to the listed character set.
  5. In the Default Character Set column, enter the default character set you’d like to use. As you type, the field will auto-complete with some of the more commonly used character sets.
  6. Click the  button.

How to: Delete a Default Character Set

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Default Character Set ] link for the directory you’d like to manage.
  4. Click the  button next to the listed character set.
  5. You will be asked to confirm the deletion of the default character set. Click the  button to finish.

How to: Manage PHP variables

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ PHP Variables ] for the directory you’d like to manage.
  4. For each option, there is an “Inherited” setting. When “Inherited” is selected, the PHP variable will inherit its value from the parent directory above. The displayed value shown next to the “Inherited” option is the value that will be used for that directory.
  5. Adjust the PHP settings as desired.
  6. Click the  button.

Available PHP Variables

Please see the PHP manual for more details about the following settings:

PHP Variable Description
Magic Quotes GPC Turns on or off the PHP ‘Magic Quotes GPC’ variable.
Register Globals Turns on or off the PHP ‘Register Globals’ variable.
Include Path Sets the PHP ‘Include Path’ variable for this directory and its subdirectories. Multiple paths are separated by a colon (“:”) character. For example: /first/path:/second/path:/third/path
Display Errors Turns on or off the PHP ‘Display Errors’ variable.
Error Reporting Sets the PHP ‘Error Reporting’ variable for this directory and its subdirectories.

How to: Add a Redirect Rule

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. Click the [ Redirects ] link.
  5. In the Redirect From column, enter the path, relative to webroot, that you would like to redirect.
  6. In the Redirect To column, enter the URL you would like to redirect to.
  7. For example, to redirect from http://yourdomain.com/some/dir to http://www.domain2.com/foo/bar, you would enter “/some/dir” in the Redirect From column and “http://www.domain2.com/foo/bar” in the Redirect Tocolumn.
  8. Set the redirect type for this redirect rule.
  9. Click the  button.

How to: Edit a Redirect Rule

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. Click the [ Redirects ] link.
  5. Click the [ Edit ] link next to the redirect rule you would like to edit.
  6. In the Redirect From column, enter the path, relative to webroot, that you would like to redirect.
  7. In the Redirect To column, enter the URL you would like to redirect to.
  8. For example, to redirect from http://yourdomain.com/some/dir to http://www.domain2.com/foo/bar, you would enter “/some/dir” in the Redirect From column and “http://www.domain2.com/foo/bar” in the Redirect Tocolumn.
  9. Set the redirect type for this redirect rule.
  10. Click the  button.

How to: Delete a Redirect Rule

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Locate the Global Directory Options section.
  4. Mark the checkboxes for the redirect rules you wish to delete. You may also click the [ Check All ] link at the bottom of the list to quickly check all the redirect rules.
  5. In the dropdown labeled with selected:, choose the Delete… option.
  6. You will be asked to confirm the deletion of the redirect rules. Click the  button to finish.

Redirect Types

Please see the Apache documentation for more information about the different redirect types.

Type Description
Temporary Returns a permanent redirect status (301) indicating that the resource has moved permanently.
Permanent Returns a temporary redirect status (302). This is the default.
See Other Returns a “See Other” status (303) indicating that the resource has been replaced.
Gone Returns a “Gone” status (410) indicating that the resource has been permanently removed. When this status is used the URL argument should be omitted.

How to: Manage Indexes

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Index Management ] link for the directory you’d like to manage.
  4. In the “Default Index Files” text box, enter a list of default index files, on per line. This setting affects when a browser requests a URL that ends in a ‘/’ (a directory). Apache will use this list of files to determine which file to serve. Apache will serve the first file found in the list, from top to bottom.
  5. Set the desired behavior for the “Directory Listing” field. This setting affects when a browser requests a URL that ends in a ‘/’ (a directory), and no Default Index files are found. If set to ‘No’, the browser will receive a ‘403 Forbidden’ response. If set to ‘Yes’, the browser will list the contents of the directory. If set to ‘Inherited’, the setting will be inherited from a parent directory.
  6. Set the desired listing style for the “Directory Listing Style” field. This setting affects how the directory listing will be displayed. If set to ‘Simple Listing’, a simple directory list of files will be displayed. If set to ‘Fancy Listing’, a directory list of files along with timestamps and filesizes will be displayed. If set to ‘Inherited’, the setting will be inherited from a parent directory.
  7. Click the  button.

How to: Manage Hotlink Protection

  1. Click the Hosting Features menu item if it is not already open.
  2. Click the Htaccess menu item.
  3. Click the [ Hotlink Protection ] link for the directory you’d like to manage.
  4. In the “Hotlink Protection Status” drop down, choose if you want the protection enabled immediately, or not. This option is useful if you’d like to turn your hotlink protection settings on or off quickly to see the difference, without deleting your hotlink protection settings and having to re-create them.
  5. Enter file extensions you want to block hotlinking for in the “Blocked Extensions” box, one per line. For example, .gif, .jpg, .wmv, .mov, etc.
  6. Enter domains you want to ALLOW hotlinking of your content from in the “Allowed domains” box.
  7. You can choose if you’d like to allow direct access to the “blocked” content or not. An example of direct access would be accessing an image with your browser like this: http://yoursite.com/images/example.gif. If “Allow Direct Access” is “Off” this will not be allowed – the request will be blocked. If it is “On” then this type of direct access will be allowed, and only embeded hotlink attempts will be blocked.
  8. If you want to replace the “blocked” content with another image file, you can enter the URL of this file in the “Replace with” text box. When this option is set with a valid absolute URL to an image file (e.g.,http://www.somedomain.com/replaceimg.jpg), a hotlinked image will be replaced with this URL. If this option is not set, a hotlinked image will return a ‘403 Forbidden’ response.
  9. Click the  button.

.htaccessaccess controldefaultcharseterror documentshandlersHotlink ProtectionIndexesMIME-typeRedirect
Nov 29, 2012, 3:35 pmBy: InterWorx
How to: Manage Advanced Settings via .htaccess in SiteWorx
0 votes, 0.00 avg. rating (0% score)
(1) Comment
  1. Francesco: I can't find the "PHP Variables" button!
    January 15, 2014 at 5:30 am
    Reply

Leave a Reply
Surround code blocks with <pre>code</pre>

Your email address will not be published.

Comments

Top Rated

Broken Link