AEM Vanity URL

AEM Vanity URL is unique, short, descriptive and easy to remember version of actual page URL.

Actual URL — http://localhost/language/aem/practice-aem-vanity.html

Vanity URL — http://localhost/aem-vanity.html

Rules to define vanity URL’s:

  1. URL must not start with /
  2. Vanity URL must be unique.
  3. We can have multiple vanity URL’s for a single page. Having multiple vanity URL’s will reduce the SEO ranking.
  4. Vanity URL’s are case sensitive.
  5. We can redirect to original page using Redirect Vanity URL.

Follow below steps to setup vanity URL’s:

1. Navigate to this URL and download vanity URL’s components package.

2. Accept EULA terms and conditions and press download button highlighted red in color.

3. Upload vanityurls-components package and install on publish instance:

4. In publish instance, everyone group must have Read permission to below hierarchy:
/libs/granite/dispatcher/content/vanityUrls

5. Open dispatcher.any and add below line to allow vanity URL rule under /filter section
/0XYZ { /type “allow” /url “/libs/granite/dispatcher/content/vanityUrls.html” }

6. In same dispatcher.any file add below line under /rules sub-section of /cache section

/00XYZ { /type “deny” /glob “/libs/granite/dispatcher/content/vanityUrls.html” }

7. Add below line in dispatcher.any file will auto-allow the item or by pass the normal dispatcher, once vanity package is installed on publishers.

/vanity_urls {
   /url    "/libs/granite/dispatcher/content/vanityUrls.html"
   /file   "/tmp/vanity_urls"
   /delay  300
}

8. Restart the Apache webserver to see latest changes.

9. Open page properties, scroll down below to Vanity URL section and author mens.html as vanity URL. Provide vanity URL and click on Save & Close button.

Publish the page once authoring is done.

10. Open below authored dispatcher vanity URL
http://localhost/mens.html

11. Author Redirect Vanity URL as true and publish page will for 301 internal redirect to actual page path.

Opening vanity URL http://localhost/mens.html in chrome browser will redirect to actual URL http://localhost/content/we-retail/us/en/men.html.

12. Open below URL to check all the vanity URL’s present:

http://localhost/libs/granite/dispatcher/content/vanityUrls.html

Imran Khan

Specialist Master (Architect) with a passion for cutting-edge technologies like AEM (Adobe Experience Manager) and a proven track record of delivering high-quality software solutions.

  • Languages: Java, Python
  • Frameworks: J2EE, Spring, Struts 2.0, Hibernate
  • Web Technologies: React, HTML, CSS
  • Analytics: Adobe Analytics
  • Tools & Technologies: IntelliJ, JIRA

🌐 LinkedIn

📝 Blogs

📧 Imran Khan