Phone technical support +39 0575 0505
Hosting > Windows Hosting > FAQs > Languages and Web Space - Configuration Tips

4.1 Languages and Web Space - Configuration Tips

A guide with tips on how to configure and manage your site.
The absolute path of the Domain is::

d:\inetpub\webs\domainnamexxx

For example, the absolute path of the Domain www.prova.it è d:\inetpub\webs\provait

In addition to the usual static pages (htm, html), Aruba Servers support:

Microsoft IIS 8.5
Pagine ASP.NET/.NET framework (2.0-3.5/4.0-4.7)
Classic ASP 3.0
Supp. Visual Studio .NET
Ajax / LINQ
MVC
PHP (selezionabile tra 5.4.x , 5.5.x e 5.6.x)
Perl 5.26
Server Side Include (SSI)
ADO.NET
XML 4
WAP

Access® Database (.mdb - .accdb) is natively supported.
The pages can also write on text files, e.g. txt, dat, log, csv, after inserting them in the folders with special permissions. The connection to the MySQL Database is also supported through the MyODBC drive, an option available for purchase as part of the additional services.
Your Homepage can be named, in order of priority, as follows:

Index.htm
Index.html
Index.asp
Index.php
Index.shtm
Index.wml
Index.aspx
Default.asp
Default.php
Default.html
Default.htm
Default.shtm
Default.wml
Default.aspx

Below is a list of codes to be used to carry out the Redirect operation and redirect users from a page (for example home) of your site to another one, or to an external one (for example in case of maintenance).

To continue, add the codes below to the default pages of your Domain

Redirect using meta tags, for htm, html and shtm pages
Add to the tags of your page the code

<META HTTP-EQUIV=REFRESH CONTENT="1; URL=https://www.aruba.it">
where 1 is the number of seconds to wait and https://www.aruba.it is the URL where visitors to the page containing this code will be redirected.

Redirect with JavaScript for htm, html and shtm pages
Between the <head> and </head> tags on your page, the code

<SCRIPT LANGUAGE="Javascript">
<!-- window.location="https://www.aruba.it" //-->
</SCRIPT>
Replace https://www.aruba.it with your own destination (you can specify a particular page)

Redirect with ASP, for ASP pages
Add only the following code to the page:

<%response.buffer=true%> <% response.redirect "https://www.aruba.it" %>
Change the target https://www.aruba.it. Always use the instruction <%response.buffer=true%> to avoid making server-side interpretation errors.

Redirect with Perl script, for ASP pages
Add only the following code to the page:

<%@LANGUAGE="PerlScript"%>
<% $url="https://www.aruba.it/servizi.htm"; $Response->Redirect("$url"); %>
Redirect with PHP, for PHP pages
Add only the following code to the page:

<? $url = "https://www.aruba.it";
if ($url) { header("Location: $url");}
else
if($QUERY_STRING) { header("Location: .urldecode($QUERY_STRING)"); }
else {
echo "Attenzione, l'URL è sbagliato";}
?>
Replace http://www.aruba.it with your own destination (you can specify a particular page).

To set the Redirect as 301 (Moved Permanently) all you need to do is change the header("Location: $url"); to: header("Location: $url", TRUE, 301);
To make sure that the -Temporary Internet Files- remain in the memory of the visitors of your website in the browser cache, the pages must be specifically programmed.

ASP Pages
Enter the following code:

Response.CacheControl = "no-cache" Response.AddHeader "Pragma", "no-cache" Response.Expires = -1
html
Enter the following code

<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
The Access Database must be placed in the mdb-database folder, which has the adequate write and security permissions.

The Access2000 and higher versions are supported. Errors might occur with lower versions (97) because they don't support the new Microsoft MDAC versions (link to Microsoft OLE DB Provider for ODBC Drivers error "80004005".

Two types of connection to the Access Database are available::
  • Via ODBC (Open DataBase Connectivity) using the ActiveX Data Object (ADO), DSN-less connection.

    To connect to the Database, the connection doesn't use DSN system files but a direct connection to the Database on the server, indicating its path. Using the Server object and its CreateObject method, the object of ADO ADODB.Connection is created.

    Dim conn Set conn = Server.CreateObject("ADODB.Connection")
    Through this, you can physically connect to our Database, which resides in the mdb-database special folder, and then open it: the connection string has all the parameters to reach the Database.

    For .mdb Database:

    conn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("/mdb-database/database.mdb")
    For .accdb Database:

    strconn = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("mdb-database\database.accdb") conn.open strconn
    With SQL you can query and interact with the Database using specific queries. At the end of the queries (not at the end of the page) immediately close any recordset objects used and the connection to the Database.

    Conn.Close Set Conn=Nothing
    The sooner you close the objects and the connection, the sooner the objects and resources necessary for the optimal management of the Database by all users will become available on the server. For the same reason, you shouldn't recall the Connection and Recordset objects in the Session or Application objects that can be instanced in the global.asa file.
  • Using **OLEDB Provider, another ADO object
To activate the connection to the Database click "Open", and try three types of queries:

  • the first query will open all the records in the NAMES table of the database, slower and heavier due to the different processing load on the server.
  • the second and the third queries will filter and require a specific number of records, sorting the results to meet your needs.

Host-related settings must be set to auto. By doing so, you will set up the best access system relating to the FTP Client used and its way to interpret the settings of the FTP Server.

The FTP Server on Aruba usually doesn't require Passive FTP but, in addition to being susceptible of variations, it is possible that, depending on the configuration and settings of an interposed network and Firewall, it may be necessary to set a passive FTP.
To ensure PHP5 compatibility with PHP4 you must make some changes to the previous code and follow some procedures while writing the new one.

Below are some instructions from the php.net supporting page
  1. Non-compatible changes
    1. Reserved keywords.
    2. Strrpos() and strripos() use the entire string as search topic

      <?php var_dump(strrpos('ABCDEF','DEF')); //int(3)
      var_dump(strrpos('ABCDEF','DAF')); //bool(false) ?>
    3. Illegal use of the offsets of the strings causes E_ERROR instead of E_WARNING. An example of illegal use is: $str = 'abc'; unset($str[0]);.
    4. array_merge() was changed to accept only arrays. If a variable that is not an array is passed, an E_WARNING will be issued for each parameter. Suddenly, the code may start to issue an E_WARNING.
    5. The PATH_TRANSLATED server variable has been changed: see the description of $_SERVER['PATH_TRANSLATED'] in the manual.
    6. An object with no properties is no longer considered "empty".

      <?php class test { } $t = new test();
      var_dump(empty($t)); // echo bool(false)
      if ($t) {
      // Viene eseguito } ?>
    7. In some cases, the classes must be declared before use. This happens only if some of the new PHP 5 features have been used (e.g. interfaces). Otherwise, the former behavior should be adopted.

      <?php
      //funziona senza errori: $a = new a(); class a { }
      //emette un errore: $a = new b();
      interface c { } class b implements c { }
      ?>
    8. get_class(), get_parent_class() and get_class_methods() in PHP 5 render the name of classes/methods as they are declared (case-sensitive) and this can lead to problems in older scripts that rely on the previous behavior (the name of the class/method was always rendered in lowercase). A possible solution is to look for these features in the scripts and use strtolower(). The change made to case-sensitivity also applies to the default magic constants __CLASS__, __METHOD__, e __FUNCTION__. The values are rendered exactly as declared (case-sensitive).
    9. ip2long() now returns FALSE when an invalid IP address passes as argument to the function and no longer -1.
    10. If there are defined functions in an included file, they can be used in the main file, regardless of whether they are before or after return(). If the file is included twice, PHP 5 will issue a fatal error because the functions were already declared. We recommend using include_once() instead of checking if the file has already been included, and make a conditional return in the included file.
    11. $thiscan't be reassigned. The example below works on PHP4 ("OK" is displayed), whereas it issues a fatal error on PHP5:

      <? class a { var $text; function a() { $this->text = 'OK'; } }
      class b { var $text = 'NOT OK'; function b() { $this = new a(); } }
      $myClass = new b(); echo $myClass->text; ?>
    12. No comments on the code with the following syntax are allowed <?=//commento?>
    13. Constructors and reference. The example above works under PHP4, whereas it issues anE_NOTICE warning on PHP5. In this case, the problem is solved by removing "&"

      <? class MyClass { function MyClass() { echo('OK'); } } $myObj = null; $myObj &= new MyClass(); ?>
      Other details are available on the dedicated page. In addition, if third-party applications, CMSes, portals, forums, guestbooks, etc. are used, make sure they are compatible with PHP5.
  2. Nuove funzioni PHP5
    1. array_combine() - Creates an array by using one array for keys and another for values.
    2. array_diff_uassoc() - Computes the difference between arrays with additional index check by a callback function provided by the user.
    3. array_udiff() - Computes the difference of arrays by using a callback function for data comparison.
    4. array_udiff_assoc() - Computes the difference of arrays with additional index check. Compares data by a callback function.
    5. array_udiff_uassoc() - Computes the difference of arrays with additional index check. Compares values by a callback function. Checks indexes by a a callback function.
    6. array_walk_recursive() - Applies a user-defined function to each element of the array recursively.
    7. array_uintersect_assoc() - Computes the intersection of arrays with additional index check. Compares data by a callback function.
    8. array_uintersect_uassoc() - Computes the intersection of arrays with the additional index check. Compares values and indexes by a callback function.
    9. array_uintersect() - Computes the intersection of arrays. Values are compared by a callback function.
The following languages aren't supported by the basic service:
  • JSP (Java Server Page
  • .cfml
  • Cold Fusion
  • J2SE
  • Tomcat
These languages are the prerogative of the Dedicated Servers or Cloud Server.
If you need to limit the availability of your website to a few specific countries, for example for reasons of copyright and registered trademarks, you can stop visitors from accessing the page in certain countries. To do this, just include a simple JavaScript code in your web page, regardless of which Hosting profile you use (Windows or Linux).

Below are two practical examples for two separate free services:
  • Using the free service Geobytes.com

    To set up the Redirect, enter the following code between <head> and </head> tags

    <script language="Javascript" src="http://gd.geobytes.com/Gd?pages=IT&ext=html&after=-1"></script>
    <script language="javascript">
    if(typeof(sGeobytesLocationCode)!="undefined"&&sGeobytesLocationCode.indexOf('IT')==0)
    {document.write("<META HTTP-EQUIV='Refresh' CONTENT='0; URL=inserire qui indirizzo'>");}
    </script>
  • Using the free service Maxmind.com

    To set up the Redirect, enter the following code between <head> and </head> tags

    <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js"></script>
    <script language="javascript">
    function check_country_code() {
    if(geoip_country_code()=="CN" || geoip_country_code()=="IN" || geoip_country_code()=="TH" || geoip_country_code()=="HK" ||      geoip_country_code()=="VN")
    window.location = 'https://www.aruba.it'
    else
    return true;}
    </script>
 
La tua opinione è importante per noi!
 

Non hai trovato quello che cerchi?

Contatta i nostri esperti, sono a tua disposizione.