Skip to main content

URL Rewrite :: HTTP redirection


Download the relevant URL Rewrite module from this URL

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-the-url-rewrite-module

Add a new website in IIS

Add bindings and enter URL in host name field from where we want user to redirect. Target URL will be added in rules in web.config file

Right click on website , add a web.config file in that folder directory and then add below redirect rule in file

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="Redirect www" stopProcessing="true">
          <match url="(.*)"/>
          <action type="Redirect" url="http://www.mysite.com/" redirectType="Permanent" appendQueryString="false"/>
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>



Comments

Popular posts from this blog

Docker Desktop service is not running, would you like to start it?

Bellow message appear while restarting Windows laptop having Docker Desktop installed. Docker Desktop service is not running, would you like to start it? Windows will ask you for elevated access. During online search, we found below solution on stackOverflow which worked for us.  Docker: Service is not running. Windows will ask you for elevated access   Please follow this solution. Hope this helps.

SQL Server

Check Fragmentation stats SELECT dbschemas . [name] as 'Schema' , dbtables . [name] as 'Table' , dbindexes . [name] as 'Index' , indexstats . alloc_unit_type_desc , indexstats . avg_fragmentation_in_percent , indexstats . page_count FROM sys . dm_db_index_physical_stats ( DB_ID (), NULL, NULL, NULL, NULL) AS indexstats INNER JOIN sys . tables dbtables on dbtables . [object_id] = indexstats . [object_id] INNER JOIN sys . schemas dbschemas on dbtables . [schema_id] = dbschemas . [schema_id] INNER JOIN sys . indexes AS dbindexes ON dbindexes . [object_id] = indexstats . [object_id] AND indexstats . index_id = dbindexes . index_id WHERE indexstats . database_id = DB_ID () ORDER BY indexstats . avg_fragmentation_in_percent desc Rebuild Indexes DECLARE  @tsql  NVARCHAR ( MAX )   DECLARE  @fillfactor  INT SET  @fillfactor  =  90 SELECT  @tsql  =    STUFF...

Export Pdf list via Sitecore PowerShell Extension

This Sitecore PowerShell utility export a list of Pdfs for specified location  $FilePath = "master:" + (Get-Item .).Paths.Path Import-Function -Name ConvertTo-Xlsx $DownloadReport = 1 $resultObj = @() $PdfList = Get-childItem -Path $FilePath -Recurse | Where-Object { $_.TemplateName -eq "Pdf"} $ItemReferrerList = "" if( $PdfList ){     $PdfList | ForEach-Object {         ######Get-ItemReferrer Start         $ItemArray = @()         $ItemReferrer = Get-ItemReferrer -ID $_.ID | Where-Object { $_.Name -ne "Admin" -and $_.ItemPath -like "/sitecore/content/*" } | Select-Object -Property ID,Version         If( $ItemReferrer ){             $ItemReferrer | ForEach-Object {                $item = Get-Item -Path master: -ID $_.ID              $latestVersion = $item.Versions.Count     ...