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

Plesk Hosting: Remove .HTML from URL

Having issues removing .html from end of URL. Have tried creating a web.config file and uploading it to the root directory with code I have found, but it doesn't seem to be working - any ideas?

 

2 ACCEPTED SOLUTIONS
New

<configuration>   
 <system.webServer>   
    <rewrite>          
        <rules>             
            <rule name="RewriteHTML">
              <match url="(.*)" />
                <conditions logicalGrouping="MatchAll">                     
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />                     
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />                 
                </conditions>                 <action type="Rewrite" url="{R:1}.html" />             
            </rule>                
        </rules>      
    </rewrite>   
 </system.webServer>  
</configuration>

View solution in original post

Thank you. This works. If you follow the code above and follow the advice given here. It won't fail. You need to open a private window and you will see it there. It takes a second or two to permanately show. Just close your normal window opened and test your pages again, you will see it.

View solution in original post

6 REPLIES 6
New

<configuration>   
 <system.webServer>   
    <rewrite>          
        <rules>             
            <rule name="RewriteHTML">
              <match url="(.*)" />
                <conditions logicalGrouping="MatchAll">                     
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />                     
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />                 
                </conditions>                 <action type="Rewrite" url="{R:1}.html" />             
            </rule>                
        </rules>      
    </rewrite>   
 </system.webServer>  
</configuration>

View solution in original post

This code works! Just remember to remove ".html" from all your links in your HTML, otherwise you won't see the effects of the web.config.

didnt work for me at all! 

Thank you. This works. If you follow the code above and follow the advice given here. It won't fail. You need to open a private window and you will see it there. It takes a second or two to permanately show. Just close your normal window opened and test your pages again, you will see it.

View solution in original post

awesome thanks man

Community Manager

Hi @Fraz. Welcome to GoDaddy Community!

 

I'm not a scripting expert, so I don't think I'll be able to shed any light on why that script isn't working for you. However, after doing some searching online, this post on Stack Overflow might be helpful. 

 

JesseW - GoDaddy | Community Manager | 24/7 support available at x.co/247support | Remember to choose a solution and give kudos.