Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Should I use relative URLs in AEM?

Avatar

Avatar
Validate 1
Level 2
steveatvisa
Level 2

Likes

4 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
steveatvisa
Level 2

Likes

4 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
steveatvisa
Level 2

23-03-2018

We are globalizing our site and sharing content with regional partners. Sometimes we are forced to send a page with broken links, for example when the page has links to local-only or content they decided not to publish.

Increasingly we are using relative URLs within our links, like "/support/consumer/benefits.html" instead of using AEM's built-in page picker. Do we lose anything if we use relative URLs? And are there any better strategies for sharing mixed content like this? TiA

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
dylanr72808383
Level 2

Likes

3 likes

Total Posts

18 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile

Avatar
Validate 1
Level 2
dylanr72808383
Level 2

Likes

3 likes

Total Posts

18 posts

Correct Reply

3 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Affirm 3
Affirm 1
View profile
dylanr72808383
Level 2

26-03-2018

The downside is that you can never really know if the content that is behind your link is actually available. Maybe vanity URL's can check it for you, or you can use a Transformer ( Apache Sling :: Output Rewriting Pipelines (org.apache.sling.rewriter​ ) to transform your normal URL's from the page picker to the relative ones? This way you can check if there is a relative URL and replace the current URL from the page picker to the relative URL when your page gets rendered.

Please note that this can have some impact on your performance though.

Answers (2)

Answers (2)

Avatar

Avatar
Validate 1
Level 2
steveatvisa
Level 2

Likes

4 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
steveatvisa
Level 2

Likes

4 likes

Total Posts

15 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
View profile
steveatvisa
Level 2

29-03-2018

Thanks very much for your replies. I was concerned AEM might lose some sort of internal tracking if we used relative URLs. The issue of broken links is less important. Since the global regions have to pay for translation cost, they can opt out of some pages. That results in broken links anyway.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

23-03-2018

URLS are discussed here -- SEO and URL Management Best Practices