cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution

web.config 500 Economy Windows Hosting with Plesk

hi,

 

I signed up to Economy Windows Hosting with Plesk and got mixed up using .htaccess and web.config.

 

I tried changing a few (Leverage Browser Caching)  settings on .htaccess but I don't think anything changed on the site, but I no crashes either.  I then tried converting the settings I made in .htaccess to web.config but immediately get a 500 error.

 

Just two questions: should I be using web.config and do I need to refresh the site somewhere to get it working.

1 ACCEPTED SOLUTION
Helper V

@aindriu80

 

Hi there,

Change your .htaccess back to your backup. More then likely something in that file is wrong ..... Go back to it and change things line by line. Your error log should have the issue in there as well. Save you loads of time 🙂

At least you will be up and running.

Mrsroadrunner Photography

View solution in original post

5 REPLIES 5
Helper V

@aindriu80

 

Hi there,

Change your .htaccess back to your backup. More then likely something in that file is wrong ..... Go back to it and change things line by line. Your error log should have the issue in there as well. Save you loads of time 🙂

At least you will be up and running.

Mrsroadrunner Photography

View solution in original post

I got it, I had 2 lines of code missing in the web.config. thanks !

@aindriu80

 

Great news you found the problem!! 🙂

 

Mrsroadrunner Photography

hi can you share a format of web.config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <system.webServer> 

      <staticContent>
			<clientCache cacheControlMode="UseExpires" httpExpires="Tue, 19 Jan 2038 03:14:07 GMT" />
      </staticContent>

	  <rewrite>    
            <rules>   
            <clear />             
                <rule name="Redirect to https" stopProcessing="true">
                    <match url=".*" />
                      <conditions>
                          <add input="{HTTPS}" pattern="off" ignoreCase="true" />
                      </conditions>
                    <action type="Redirect" url="https://website.com{REQUEST_URI}" redirectType="Permanent" appendQueryString="false" />
                </rule>

                <rule name="Redirect to non-www" stopProcessing="true">
                  <match url="(.*)" negate="false" />                  
                  <conditions>
                      <add input="{HTTP_HOST}" pattern="^website\.com$" negate="true" />
                  </conditions>
                  <action type="Redirect" url="https://website.com/{R:1}" />
                </rule>

            </rules>
        </rewrite>

         <rewrite>    
        <outboundRules rewriteBeforeCache="true">
          <rule name="Remove Server header">
            <match serverVariable="RESPONSE_Server" pattern=".+" />
            <action type="Rewrite" value="" />
          </rule>
        </outboundRules>
</rewrite>      

		 <httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
      <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
      <dynamicTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="application/json" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </dynamicTypes>
      <staticTypes>
        <add mimeType="text/*" enabled="true" />
        <add mimeType="message/*" enabled="true" />
        <add mimeType="application/x-javascript" enabled="true" />
        <add mimeType="application/atom+xml" enabled="true" />
        <add mimeType="application/xaml+xml" enabled="true" />
        <add mimeType="*/*" enabled="false" />
      </staticTypes>
    </httpCompression>
    
    <urlCompression doStaticCompression="true" doDynamicCompression="true" />
   </system.webServer>   
</configuration>

its using caching, compression, and only 1 redirect for https.