URL Rewrite Rules

Modified on Tue, 23 Mar 2021 at 11:35 AM

Your eRATEX site FTP folders contains one called /Config. The file RewriteRules.config  (and with proper coding, the RewriteMaps.config and RewriteOutboundRules.config ) can be used to create URL redirect and rewrite rules for your site.


Creating proper redirect / rewrite rules is essential for the functionality of the site, so if in doubt, please refer to your RATEX Support representative for assistance.


There are some default rewrite rules already in your RewriteRules.config file, most of which should be left intact. The one that you might consider changing is the "www" rule, which should be near the top of the file. To enable this rule (always use "www" on your URLs), simply change the line:


<rule name="Ensure www subdomain" enabled="false">


To:


<rule name="Ensure www subdomain" enabled="true">


As always when using your FTP to modify files, please follow these simple rules:

  1. Download and save a copy of your original unmodified file to your local computer or network.
  2. Use a good text editor such as Notepad ++
  3. Work with a copy of the file being edited, in a different folder.
  4. Be sure to review your changes for typos and errors before posting it back up to the site files (uploading).
  5. Be prepared to replace the modified file with the unmodified original you have saved, in case of errors or undesired results.
  6. Some changes require a site restart before taking effect. This includes the /Config files. If you need to test the site changes sooner (will restart itself sometime within 24 hours), please contact your RATEX Support and request a website restart from hosting.


An example of what you can do with Rewrite Rules:


"Vanity" Rules:

Vanity URLs are simpler, more friendly and recognizable URLs that redirect to a more complex page.

Be sure you only change the highlighted entries in the rule, leaving everything else as-is.


    <rule name="Alumni Rewrite" stopProcessing="true">

        <match url="^alumni$" />

        <action type="Rewrite" url="t-alumni-information.aspx" />

    </rule>


This example would take the entered "vanity" URL:

https://www.mysite.com/alumni


and redirect user to a real existing page:

https://www.mysite.com/t-alumni-information.aspx   (Legacy URL)

https://www.mysite.com/topic/alumni-information   (Modern URL)


NOTE: If your site is using Configuration - GlobalConfig Parameters - URLMode "Modern Only", you will need to change it to "Modern with Legacy 301 Redirects", and be sure to always use the legacy version of the URL such as t-alumni-information.aspx rather than topic/alumni-information in the rewrite rule.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article