Chapter 78: Controller: /siteworx/ftp/sessions Up Part III: SiteWorx API Spec Chapter 80: Controller: /siteworx/index 

79 Controller: /siteworx/htaccess

Required Permissions "HTACCESS"
Action: accessControl
Added in version 5.0.15-659
Description Edit .htaccess access control settings.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
order string Help Entry
Sets the order in which the Trusted (Allow) and Blocked (Deny) lists are evaluated.<ul><li><b>Deny first, then allow</b> - The ’Blocked Hosts’ list will be evaluated first.</li><li><b>Allow first, then deny</b> - The ’Trusted Hosts’ list will be evaluated first.</li></ul>
Example Values
deny,allow, allow,deny
Yes
allow struct (string) Help Entry
IPs or domain names listed here will be allowed access to this directory and its subdirectories.
No
deny struct (string) Help Entry
IPs or domain names listed here will be denied access to this directory and its subdirectories.
No
Action: add
Added in version 4.7.0-339
Description Add a global .htaccess file.
Action: addHandler
Added in version 5.0.15-659
Description Add a .htaccess handler setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
handler string Yes
extensions string Yes
Action: addMimetype
Added in version 5.0.15-659
Description Add a .htaccess mimetype setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
mimetype string Yes
extensions string Yes
Action: addPer
Added in version 5.0.15-659
Description Add an .htaccess file.
Input Parameters
Name Type Notes Required?
new_dir string Example Values
/home/example/example.com/html/cgi-bin, /home/example/example.com/html/sub
Yes
status integer Example Values
1, 0
Example Default Value
enabled
No*
* indicates that it’s actually required, but probably already has a valid default value
Action: addRedirect
Added in version 5.0.15-659
Description Add a .htaccess redirect setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
redir_from string Yes
redir_to string Yes
status string Example Values
temp, permanent, seeother, gone
Yes
Action: characterSet
Added in version 5.0.15-659
Description Edit .htaccess charset setting.
Input Parameters
Name Type Notes Required?
charset string Help Entry
Set the default character set used
Example Values
UTF-8, ISO-8859-1, UTF-16BE, UTF-16LE, UTF-16, ANSI_X3.4-1968, ISO-10646-UTF-1, ISO_646.basic:1983, INVARIANT, ISO_646.irv:1983, BS_4730, NATS-SEFI, NATS-SEFI-ADD, NATS-DANO, NATS-DANO-ADD, SEN_850200_B, SEN_850200_C, KS_C_5601-1987, ISO-2022-KR, EUC-KR, ISO-2022-JP, ISO-2022-JP-2, ISO-2022-CN, ISO-2022-CN-EXT, JIS_C6220-1969-jp, JIS_C6220-1969-ro, IT, PT, ES, greek7-old, latin-greek, DIN_66003, NF_Z_62-010_(1973), Latin-greek-1, ISO_5427, JIS_C6226-1978, BS_viewdata, INIS, INIS-8, INIS-cyrillic, ISO_5427:1981, ISO_5428:1980, GB_1988-80, GB_2312-80, NS_4551-1, NS_4551-2, NF_Z_62-010, videotex-suppl, PT2, ES2, ...
No
Action: delete
Added in version 4.7.0-339
Description Delete a .htaccess file.
Input Parameters
Name Type Notes Required?
htaccess_dirs struct (string) Example Values
global, /home/example/example.com/html
Yes
Action: deleteHandler
Added in version 5.0.15-659
Description Delete a .htaccess handler setting.
Input Parameters
Name Type Notes Required?
handler struct (string) Yes
dir string Example Values
global, /home/example/example.com/html
Yes
Action: deleteMimetype
Added in version 5.0.15-659
Description Delete a .htaccess mimetype setting.
Input Parameters
Name Type Notes Required?
mimetype struct (string) Yes
dir string Example Values
global, /home/example/example.com/html
Yes
Action: deleteRedirect
Added in version 5.0.15-659
Description Delete a .htaccess redirect setting.
Input Parameters
Name Type Notes Required?
redirect struct (string) Help Entry
Redirect one URL to a new URL. The "Redirect From" field takes a path relative to the web root, while the "Redirect To" takes an absolute URL to another site.<br/><br/><b>Example:</b><br/>To redirect from http://yourdomain.com/some/dir to http://www.domain2.com/foo/bar, you would enter<br/><table border><tr><td>Redirect From</td><td>Redirect To</td></tr><tr><td>/some/dir</td><td>http://www.domain2.com/foo/bar</td></tr></table>
Yes
dir string Example Values
global, /home/example/example.com/html
Yes
Action: dirIndex
Added in version 5.0.15-659
Description Edit .htaccess directory index.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
default_indexes struct (string) Help Entry
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.
No*
listing string Help Entry
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.
Example Values
inherited, on, off
Yes
listing_style string Help Entry
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.
Example Values
inherited, simple, fancy
Yes
* indicates that it’s actually required, but probably already has a valid default value
Action: disable
Added in version 4.7.0-339
Description Disable a .htaccess file.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Action: edit
Added in version 5.0.15-659
Description Edit an .htaccess file.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Action: editHandler
Added in version 5.0.15-659
Description Edit a .htaccess handler setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
handler string Yes
extensions string Yes
Action: editMimetype
Added in version 5.0.15-659
Description Edit a .htaccess mimetype setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
mimetype string Yes
extensions string Yes
Action: editRedirect
Added in version 5.0.15-659
Description Edit a .htaccess redirect setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
redir_from string Yes
redir_to string Yes
status string Example Values
temp, permanent, seeother, gone
Yes
Action: enable
Added in version 4.7.0-339
Description Enable a .htaccess file.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Action: hotlink
Added in version 5.0.15-659
Description Edit .htaccess hotlink setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
status string Help Entry
Turns hotlink protection on or off.
Example Values
off, on
Yes
extensions struct (string) Help Entry
Sets the list of extensions that will be protected from hotlinking.
No
allow_urls struct (string) Help Entry
Sets the list of allowed domains that are allowed to hotlink to files with the listed extensions. The current SiteWorx domain will always be allowed to hotlink to the listed extensions.
Example Default Value
{"http:\/\/example.com":"http:\/\/example.com","http:\/\/www.example.com":"http:\/\/www.example.com"}
No
allow_direct string Help Entry
This option allows "direct access" to the list of protected extensions. "Direct access" typically means the URL of the file is typed directly into the browser, and not linked from another page. More specifically, "Direct access" allows access to the protected extensions when the HTTP_REFERER field is empty.
Example Values
off, on
Example Default Value
off
No*
replace_with string Help Entry
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.
No
* indicates that it’s actually required, but probably already has a valid default value
Action: phpVar
Added in version 5.0.15-659
Description Edit .htaccess php variable setting.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
magic_quotes_gpc string Help Entry
Turns on or off the PHP ’Magic Quotes GPC’ variable. If set to ’Inherited’, the value will be set to what is shown between the parenthesis. Please refer to the PHP documentation for more information on the ’Magic Quotes GPC’ variable.
Example Values
inherited, on, off
Yes
register_globals string Help Entry
Turns on or off the PHP ’Register Globals’ variable. If set to ’Inherited’, the value will be set to what is shown between the parenthesis. Please refer to the PHP documentation on more information on the ’Register Globals’ variable.
Example Values
inherited, on, off
Yes
include_inherited integer Example Values
1, 0
Example Default Value
1
No*
include_path string Help Entry
Sets the PHP ’Include Path’ variable for this directory and its subdirectories. If the ’Inherited’ box is checked, the value will be set to what is shown in the textbox. Please refer to the PHP documentation on more information on the ’Include Path’ variable.
No
display_errors string Help Entry
Turns on or off the PHP ’Display Errors’ variable. If set to ’Inherited’, the value will be set to what is shown between the parenthesis. Please refer to the PHP documentation for more information on the ’Display Errors’ variable.
Example Values
inherited, on, off
Yes
report_inherited integer Example Values
1, 0
Example Default Value
1
No*
error_reporting struct (integer) Help Entry
Sets the PHP ’Error Reporting’ variable for this directory and its subdirectories. If the ’Inherited’ box is checked, the value will be inherited from a parent directory, and the checkboxes will be set accordingly. Please refer to the PHP documentation for more information on the ’Error Reporting’ variable.
Example Values
1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 32767
No
* indicates that it’s actually required, but probably already has a valid default value
Action: queryCharacterSet
Added in version 5.1.0-838
Description Displays the information available to the action "characterSet".
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’charset’ => NULL,
’dir’ => ’/home/example/example.com/html/cgi-bin’,
),
)
Action: queryEdit
Added in version 5.1.0-838
Description Displays the information available to the action "edit".
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Sample output
array (
’status’ => 0,
’payload’ =>
array (
’dir_copy’ => ’global’,
’dir’ => ’global’,
),
)
Action: queryGlobalDir
Added in version 5.0.15-659
Description Lists information about htaccess.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
0 =>
array (
’directory’ => ’/home/example/example.com/html’,
’status’ => true,
),
),
)
Action: queryHandlers
Added in version 5.0.15-659
Description Lists information about Handlers.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Action: queryMimetypes
Added in version 5.0.15-659
Description Lists information about Mimetypes.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
Action: queryPerDir
Added in version 5.0.15-659
Description Lists information about htaccess.
Sample output
array (
’status’ => 0,
’payload’ =>
array (
),
)
Action: queryRedirects
Added in version 5.0.15-659
Description Lists information about Redirects.
Input Parameters
Name Type Notes Required?
dir string Example Values
global, /home/example/example.com/html
Yes
 Chapter 78: Controller: /siteworx/ftp/sessions Up Part III: SiteWorx API Spec Chapter 80: Controller: /siteworx/index 

(C) 2017 by InterWorx LLC