AEM : How to extend the vanity URL?

ForrestLi

09-06-2020

Hi all,

 

Page : /content/home/welcome

Vanity URL : wel

 

If I enter the https://docker.demo.com/wel , The browser will redirect me to https://docker.demo.com/content/home/welcome.html.  But I want browser redirect me to the https://docker.demo.com/home/welcome.html .

 

Does anyone know how to extend Vanity to achieve this function?

 

Thanks,

Forrest

Accepted Solutions (1)

Accepted Solutions (1)

surabhikatiyar

Employee

11-06-2020

there are a couple of solutions to achieve this. 

One of the solutions is:-

1. Create a servlet in AEM to create the vanity paths present under the project hierarchy. 

2. Create a shell script in apache to hit the above AEM servlet on a periodic basis and save it in a file(vanity_urls.txt) on apache.

3. Create the re-write rules at the Apache level in httpd.conf file.

These rules will check whether the path requested exists in the file (vanity_urls.txt) and based on the result will do the shortening conditionally.

Answers (3)

Answers (3)