AEM : How to extend the vanity URL? | Community
Skip to main content
Level 3
Jun 9, 2020 8:12 AM UTC
Solved

AEM : How to extend the vanity URL?

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Surabhi_Katiyar
Surabhi_KatiyarAccepted solution
Employee
Jun 11, 2020 3:40 PM UTC

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.

4 replies

Surabhi_Katiyar
Surabhi_KatiyarAccepted solution
Employee
Jun 11, 2020 3:40 PM UTC

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.

Translate
Employee
Jun 9, 2020 12:52 PM UTC

There are many ways to achieve your requirement. If you need to redirect all pages, you might want to do that activities son Apache/Dsipacther level.

If this is for some pages only you can employ Vanity URL field on the Page Properties dialog 

Translate
VeenaVikraman
New Participant
Jun 9, 2020 11:52 AM UTC

I think as @harwinder-singh you might have to look at resource mapping.

Translate
Harwinder-singh
New Participant
Jun 9, 2020 10:55 AM UTC