Creating URL redirects
1. URL redirects are useful when an expired link needs to route to a new location.
2. We will do a redirect on the following example URL to another location on the same site:
3. To create a redirect, first recreate the folder structure leading up to the HTML file:
The above folder structure consists of a tea folder within an overall beverages folder:
Here are the steps on folder creation:
a. To create a folder, press New () in the Explorer Menu at the top.
b. From the next screen, select Folder and press Continue.
c. Next, type the name of the folder in lower case (eg. beverages) and press Continue.
d. Give the folder a Title (eg. Beverages), make sure it is not added to the site navigation and press Finish.
4. Once an identical folder structure has been created in OpenCms, generate a redirect file on the .html portion of the link:
5. To do so, open the newly created folder structure (eg. beverages > tea) and press New () in the Explorer Menu at the top.
6. From the next screen, select HTML Redirect:
7. Give the redirect file a name that is identical to the .html portion of the URL above and press Continue:
8. In the next screen, enter a descriptive Title (for your reference) and make sure that Add to navigation is unticked. Then press Finish.
9. Next, edit the file you have just created to embed the new link destination:
10. In the editor, hover over the OpenCms icon on the right and press the green Add New button:
11. Next, press the folder icon () on the right to open the site navigation structure. Then click on the new file you wish to redirect to (expand the relevant folders in the pop up and then click on the final destination file). Once the new link has been embedded, select Permanent as the redirect type:
12. Lastly, press Save and close () at the top. Publish () changes and test the URL redirect in a new window.