Skip to main content
Mar 9, 2017 12:07 AM UTC
Solved

AEM 6.0 vanity URLs under /content/dam unavailable after restart

I'm manually creating vanity URLs on assets by setting the sling:vanityPath parameter under the asset's content node. This works fine for pages, and initially is working great for dam assets, but after rebooting the assets are no longer available under the vanity URLs and return a 404. Is there some other place I need to configure them?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 9, 2017 10:37 PM UTC

Looks like AEM has a bug. I CAN reproduce this! I recommend opening a ticket so support can investigate. 

4 replies

kautuk_sahni
Level 9
Mar 9, 2017 12:56 PM UTC

Hi,

The concept of vanity path is:

Go to the jcr:content node of Page/Asset and add a property "sling:vanityPath"  with some "Value".

This will create a Vanity URL for that Node.

For Assets:

1. Go to the assets in crx/de

2. open jcr:content of that PDF/Image/Asste.

3. Add """sling:vanityPath"  with some "Value"

Now open "http://localhost:4502/<Value>"

I tried this and it is working for me. Unable to reproduce this behavior. 

~kautuk

Translate
Kautuk Sahni
Mar 9, 2017 4:11 PM UTC

Did you then shutdown and restart the server?  We've tried this on multiple servers and multiple AEM versions now and the behavior is the same.  The initial sling:vanityPath setting works, but after a restart it no longer does.  Also it works for pages, just not assets.  It looks like the Resource Resolver is only being initialized with vanityPaths from page assets. 

Translate
smacdonald2008
smacdonald2008Accepted solution
Level 10
Mar 9, 2017 10:37 PM UTC

Looks like AEM has a bug. I CAN reproduce this! I recommend opening a ticket so support can investigate. 

Translate
smacdonald2008
Level 10
Mar 9, 2017 10:54 PM UTC

After starting - what did work - renders: 

<html> <head> <title>File not found</title> </head> <body> <p>A custom errorhandler for 404 responses</p> </body> </html>
Translate