9 messaggi dal 20 marzo 2014
buongiorno a Tutti))
Dunque premetto di essere un neofita nella costruzione di siti web, e non so neppure se sono nel posto giusto per il mio problema. Ma spero comunque di avere Aiuto))
Dunque come si evince dal titolo il mio problema è la configurazione del file: web.config... anche se ad essere sincero, penso di avere saltato qualche cosa nella configurazione dell'hosting. Ho già scritto all'hosting in questione esponendogli il problema, come risposta mi hanno mandato dei link già visti in questa mia affannata ricerca che ormai dura da giorni..
Questo è uno dei file che ho postato in questi giorni, sempre invano...è vero devo dire anche il perchè, cioè quale sia il mio obiettivo:
img/4G.png (expiration not specified)
asidegif.gif (expiration not specified) ecc. ecc.
img/daikin.png (expiration not specified)
js/jquery.js (expiration not specified)
style.css (expiration not specified) ecc. ecc.

Spero di essere stato sufficientemente esaustivo, qui il mio file:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="system.webServer">
<sectionGroup name="rewrite">
<section name="rewriteMaps" overrideModeDefault="Allow" />
<section name="rules" overrideModeDefault="Allow" />
</sectionGroup>
</sectionGroup>
</configSections>
<security>
<requestFiltering>
<denyUrlSequences>
<add sequence="engine" />
<add sequence="inc" />
<add sequence="info" />
<add sequence="module" />
<add sequence="profile" />
<add sequence="po" />
<add sequence="sh" />
<add sequence="theme" />
<add sequence="tpl(\.php" />
<add sequence="Root" />
<add sequence="Tag" />
<add sequence="Template" />
<add sequence="Repository" />
<add sequence="code-style" />
</denyUrlSequences>
<fileExtensions>
<add fileExtension=".sql" allowed="false" />
<add fileExtension=".pl" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
<directoryBrowse enabled="true" />
<staticContent>
<clientCache cacheControlMode="UseExpires" httpExpires="Sun, 1 Jan 2017 00:00:00 UTC" />
</staticContent>
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
<add extension="http://www.ilcondizionatore.net/style.css" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
</profiles>
</caching>
<rewrite>
<rules>
<rule name="block favicon" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1"
statusReason="The requested file favicon.ico was not found"
statusDescription="The requested file favicon.ico was not found" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^condizionatore\.net$" />
</conditions>

<action type="Redirect" redirectType="Permanent" url="http://www.ilcondizionatore.net/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.html?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.html" />
<add value="index.html" />
</files>
</defaultDocument>

<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/index.html" responseMode="ExecuteURL" />
</httpErrors>



<system.webServer>
<staticContent>
<clientCache cacheControlMode="UseMaxAge"
cacheControlMaxAge="7.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
11.886 messaggi dal 09 febbraio 2002
Contributi
ciao e benvenuto nel forum,

corroio ha scritto:

Spero di essere stato sufficientemente esaustivo

Eeerr, no. Non si è capito nulla :)

Qual è il problema di quei file, non riesci a visualizzarli? Il file css mi sembra che funzioni.
I tecnici dell'hosting che link ti hanno mandato?

ciao,
Moreno
Modificato da BrightSoul il 20 marzo 2014 22.44 -

Enjoy learning and just keep making
9 messaggi dal 20 marzo 2014
Grazie per la risposta))
dunque il problema è la data di scadenza non specificata per la cache.
Io ho provato in diversi modi, ma non capisco bene come devo fare.
page speed e Yslow danno questo risultato:
----------------------------------
The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources:
vari file: png gif jpg(expiration not specified)
js/jquery.js (expiration not specified)
style.css (expiration not specified)
---------------------------------------------
Inoltre Yslow scrive anche:
There are 13 components with misconfigured ETags.

Come posso fare? Grazie Corrado
9 messaggi dal 20 marzo 2014
Aggiornamento
Dunque attualmente cerco di correggere i seguenti errori... anche se non capisco come dovrei fare)))
------------------------
Server Error in '/' Application.
Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: The 'type' attribute must be specified on the 'section' tag.
Source Error:
Line 3: <configSections>
Line 4: <sectionGroup name="rewrite">
Line 5: <section name="rewriteMaps" overrideModeDefault="Allow" />
Line 6: <section name="rules" overrideModeDefault="Allow" />
Line 7: </sectionGroup>

Source File: E:\inetpub\vhosts\ilcondizionatore.net\httpdocs\web.config Line: 5


Show Additional Configuration Errors:


The 'type' attribute must be specified on the 'section' tag. (E:\inetpub\vhosts\..\httpdocs\web.config line 6)

Unrecognized configuration section security. (E:\inetpub\vhosts\...\httpdocs\web.config line 12)

Unrecognized configuration section directoryBrowse. (E:\inetpub\vhosts\...\httpdocs\web.config line 36)

Unrecognized configuration section staticContent. (E:\inetpub\vhosts\....\httpdocs\web.config line 37)

Unrecognized configuration section caching. (E:\inetpub\vhosts.....\httpdocs\web.config line 40)


Aiutoooooooooooooooo!!!!!!!!!!!!!!
11.886 messaggi dal 09 febbraio 2002
Contributi
Calma e sangue freddo.

Visual Studio ti dà degli strumenti per creare un web.config valido.
  • Mentre digiti, l'Intellisense ti suggerisce gli elementi e gli attributi che puoi usare
  • Durante la compilazione, ti verrà subito evidenziato qualsiasi errore di configurazione, così che tu non debba ogni volta ripubblicare il sito per accorgerti degli eventuali problemi.


Se hai accesso al server, fai i tuoi settaggi dalla console di IIS. Apportare cambiamenti dall'interfaccia grafica sarà inizialmente più semplice e il risultato sarà il medesimo perché ogni configurazione verrà comunque salvata nel web.config dell'applicazione.

Se invece non hai accesso al server, sistema a mano il tuo web.config come segue:
  • Togli l'intero elemento <configSections>, non credo sia necessario.
  • Il nodo <system.webServer> deve abbracciare gli altri elementi security, directoryBrowse, staticContent e caching.


Per tornare al tuo quesito iniziale: per impostare le intestazioni relative alla cache, va bene usare la sezione staticContent/clientCache che hai già nel web.config. Qui c'è un articolo che ne parla.
http://www.iis.net/configreference/system.webserver/staticcontent/clientcache

ciao,
Moreno

Enjoy learning and just keep making
9 messaggi dal 20 marzo 2014
Ciao Moreno, innanzi tutto grazie per il tuo interessamento.
No, purtroppo non riesco a venirne a capo, ho sempre il solito problema di specificare la data di scadenza
--------------------------------------
Grade F on Add Expires headers
There are 14 static components without a far-future expiration date.
-----------------------------------------------
Dunque io non uso Visual Studio e la scoperta del file web.config per me è nuova(grande ignoranza))... Ho seguito il tuo suggerimento e ho recuperato e modificato il file(web.config) che avevo postato inizialmente, in questi giorni l'ho cambiato diverse volte; poi l'ho posto nuovamente.
Dunque io il file lo modifico o in locale, oppure direttamente sul server, attraverso il parallels desk, andando in file manager, dove mi è anche possibile lanciarlo e vedere quali errori ci possano essere.
Attualmente gli errori che mi da sono questi:
---------------------------------------------------------
Server Error in '/' Application.
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.config' may be incorrect. Please review the URL below and make sure that it is spelled correctly.
Requested URL: /web.config
--------------------------------------------------------------
Ecco io non capisco perchè la pagina possa essere proibita, oppure l'estensione non sia corretta..... questo mi fa pensare che comunque il file sia scritto in maniera corretta, e che io debba cercare l'errore da altra parte: ma dove?))
Grazie Corrado)
-----------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<denyUrlSequences>
<add sequence="engine" />
<add sequence="inc" />
<add sequence="info" />
<add sequence="module" />
<add sequence="profile" />
<add sequence="po" />
<add sequence="sh" />
<add sequence="theme" />
<add sequence="tpl(\.php" />
<add sequence="Root" />
<add sequence="Tag" />
<add sequence="Template" />
<add sequence="Repository" />
<add sequence="code-style" />
</denyUrlSequences>
<fileExtensions>
<add fileExtension=".sql" allowed="false" />
<add fileExtension=".pl" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
<directoryBrowse enabled="true" />
<staticContent>
<clientCache cacheControlMode="UseExpires"
httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" />
</staticContent>
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
<add extension="http://www.ilcondizionatore.net/style.css" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
</profiles>
</caching>
<rewrite>
<rules>
<rule name="block favicon" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1"
statusReason="The requested file favicon.ico was not found"
statusDescription="The requested file favicon.ico was not found" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^condizionatore\.net$" />
</conditions>

<action type="Redirect" redirectType="Permanent" url="http://www.ilcondizionatore.net/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.html?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.html" />
<add value="index.html" />
</files>
</defaultDocument>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
</httpErrors>
<staticContent>
<clientCache cacheControlMode="UseMaxAge"
cacheControlMaxAge="7.00:00:00" />
</staticContent>
</system.webServer>
</configuration>
11.886 messaggi dal 09 febbraio 2002
Contributi
ciao Corrado,

corroio ha scritto:

Server Error in '/' Application.
This type of page is not served.

E' normale che sia così, per motivi di sicurezza.
Il file web.config, come altri tipi di file, può contenere informazioni riservate e per questo motivo il webserver IIS ne nega la visualizzazione quando si tenta di raggiungerlo dal suo indirizzo.

Mi sembra che gli altri errori ora siano spariti, quindi siamo un passo avanti anche se può darsi che adesso il tuo web.config contenga cose che non ti servono. Vedo per esempio che l'elemento <staticContent> è ripetuto due volte, e questo è un problema.

Prova ad inserire nel web.config questo codice, per ora.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.webServer>
    <security>
      <requestFiltering>
        <denyUrlSequences>
          <add sequence="engine" />
          <add sequence="inc" />
          <add sequence="info" />
          <add sequence="module" />
          <add sequence="profile" />
          <add sequence="po" />
          <add sequence="sh" />
          <add sequence="theme" />
          <add sequence="tpl(\.php" /> <!-- questo è corretto? -->
          <add sequence="Root" />
          <add sequence="Tag" />
          <add sequence="Template" />
          <add sequence="Repository" />
          <add sequence="code-style" />
        </denyUrlSequences>
        <fileExtensions>
          <add fileExtension=".sql" allowed="false" />
          <add fileExtension=".pl" allowed="false" />
        </fileExtensions>
      </requestFiltering>
    </security>
    <caching>
      <profiles>
        <add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
        <add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
      </profiles>
    </caching>
    <rewrite>
      <rules>
        <rule name="block favicon" stopProcessing="true">
          <match url="favicon\.ico" />
          <action type="CustomResponse" statusCode="404" subStatusCode="1"
          statusReason="The requested file favicon.ico was not found"
          statusDescription="The requested file favicon.ico was not found" />
        </rule>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{HTTP_HOST}" pattern="^condizionatore\.net$" />
          </conditions>
          <action type="Redirect" redirectType="Permanent" url="http://www.ilcondizionatore.net/{R:1}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^(.*)$" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.html?q={R:1}" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
    <defaultDocument>
      <files>
        <remove value="index.html" />
        <add value="index.html" />
      </files>
    </defaultDocument>
    <httpErrors>
      <remove statusCode="404" subStatusCode="-1" />
      <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
    </httpErrors>
    <staticContent>
      <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="7.00:00:00" />
    </staticContent>
  </system.webServer>
</configuration>


La sezione staticContent/clientCache servirà ad emettere un'instazione Cache-Control che YSlow dovrebbe gradire.


ciao,
Moreno

Enjoy learning and just keep making
9 messaggi dal 20 marzo 2014
Ciao Moreno e di nuovo grazie)
Dunque, ho provato ma non cambia niente, ho i soliti 14 file: immagini, css e js, senza una precisa scadenza... ho meglio la scadenza c'è, ma è breve
---------------------
pagespeed: The following cacheable resources have a short freshness lifetime. Specify an expiration at least one week in the future for the following resources
----------------
ylow: There are 14 static components without a far-future expiration date
----------------------------
Quindi mi viene da pensare... cioè non so più cosa pensare!!!))

Il file che mi hai postato, io ho provato anche a mischiarlo un po, aggiungendo e togliendo qualche cosa, ma il risultato non è mai cambiato.
Mi hai chiesto se è corretto questo tag: <add sequence="tpl(\.php" />, scusa la mia ignoranza, ma non so cosa sia... comunque io lavoro in html ed ho anche un paio di pagine in php, quindi ho provato sia a toglierlo che rimetterlo modificato in html, sia a rimetterli tutti due, come avrai modo di vedere nel file che ti posto... ho provato anche a cambiare qualche cosa per il file css, in modo da poter vedere immediatamente se riuscivo a "indovinare" il giusto percorso, ma niente))
Ciao e di nuovo grazie)
--------------------------------------
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<security>
<requestFiltering>
<denyUrlSequences>
<add sequence="engine" />
<add sequence="inc" />
<add sequence="info" />
<add sequence="module" />
<add sequence="tpl(\.html" />
<add sequence="tpl(\.php" />
<add sequence="profile" />
<add sequence="po" />
<add sequence="sh" />
<add sequence="Root" />
<add sequence="Tag" />
<add sequence="Repository" />
<add sequence="code-style" />
</denyUrlSequences>
<fileExtensions>
<add fileExtension=".sql" allowed="false" />
<add fileExtension=".pl" allowed="false" />
</fileExtensions>
</requestFiltering>
</security>
<caching>
<profiles>
<add extension=".php" policy="DisableCache" kernelCachePolicy="DisableCache" />
<add extension=".html" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
<add extension="/.css" policy="CacheForTimePeriod" kernelCachePolicy="CacheForTimePeriod" duration="14:00:00:00" />
</profiles>
</caching>
<rewrite>
<rules>
<rule name="block favicon" stopProcessing="true">
<match url="favicon\.ico" />
<action type="CustomResponse" statusCode="404" subStatusCode="1"
statusReason="The requested file favicon.ico was not found"
statusDescription="The requested file favicon.ico was not found" />
</rule>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^condizionatore\.net$" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="http://www.ilcondizionatore.net/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.html?q={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.html" />
<add value="index.html" />
</files>
</defaultDocument>
<httpErrors>
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>

----------

Torna al forum | Feed RSS

ASPItalia.com non è responsabile per il contenuto dei messaggi presenti su questo servizio, non avendo nessun controllo sui messaggi postati nei propri forum, che rappresentano l'espressione del pensiero degli autori.