Thursday 14 December 2017

Redirect HTTP to HTTPS automatically

Windows & Plesk Server
Windows-based accounts use web.config files to handle redirection.
Using the following code in your web.config file automatically redirects visitors to the HTTPS version of your site:

           Copy the following code in Web.config file under the SYSTEM.WEBSERVER” section.
<rewrite>
    <rules>
        <rule name="HTTP to HTTPS redirect" stopProcessing="true">
        <match url="(.*)" />
        <conditions>
               <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        </conditions>
        <action type="Redirect" redirectType="Permanent" url="https://{HTTP_HOST}/{R:1}" />
</rule>  
    </rules>
</rewrite>

2.       Save the web.config file and upload in Website root folder.

If you have an existing web.config file:
  • Ensure you have sections (i.e. opening and closing tags) for:
    • system.webServer (which contains rewrite)
    • rewrite (which contains rules)
    • rules (which contains one or more rule sections)
Insert any of those sections that do not exist.
  • Insert the entire rule section, including matchconditions, and action, inside the rules section.
 Note: You're inserting the rule (without an 's') inside the rules (with an 's') section.


Thursday 27 April 2017

Change Default RDP Port

Change Default RDP Port


Follow the steps below to configure the change RDP Port for Windows Server 2012 & Windows Server 2016 and Server 2019



1. Right Click on Start Menu → Click on Run Tab

2. Type regedit → Click on Ok Button

3. Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

4. Double click on Portnumber and Click On the Edit menu, click Modify, and then click Decimal.

5. Type the new port number 3437, and then click OK.

6. Click OK

7. Quit Registry Editor.

8. Restart the computer.

Note When you try to connect to this computer by using the Remote Desktop connection, you must type the new port. Maybe you have to set the firewall to allow the new port number before you connect to this computer by using the Remote Desktop connection.