Can we change AEM redirects on page properties from 302 to 301 as default?

Avatar

Avatar
Validate 1
Level 1
srikoll
Level 1

Likes

3 likes

Total Posts

15 posts

Correct reply

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

Avatar
Validate 1
Level 1
srikoll
Level 1

Likes

3 likes

Total Posts

15 posts

Correct reply

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

30-06-2020

In AEM page properties, we can set URL redirects. Adobe support informed that these are 302 redirects.

 

Is there a way to override this so by default they become 301 redirects and not 302?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile

Avatar
Give Back 5
Employee
vanegi
Employee

Likes

392 likes

Total Posts

378 posts

Correct reply

148 solutions
Top badges earned
Give Back 5
Give Back 3
Give Back 10
Give Back
Boost 50
View profile
vanegi
Employee

01-07-2020

This redirection of request URLs in AEM can be configured at the Sling level, typically in the mapping configuration under /etc/map node. There are two ways of changing the status code:

 

1) By sling:status property

 

You can use sling:status property to set a specific status code for a particular redirection. Here is an example:

 

/etc/map

      +-- http

           +-- example.com.80

           |    +-- sling:redirect = "http://www.example.com/"

           |    +-- sling:status = "301"

 

Please check the document [0] for more details.

 

[0]: https://sling.apache.org/documentation/the-sling-engine/mappings-for-resource-resolution.html

 

 

2) Via OSGI configuration

 

Another way, which really sets the default for all redirection, is to configure the status code at the OSGi bundle level. In the OSGi console, browse the the Configuration page and locate: “Apache Sling Resource Resolver Factory” and change the redirect status field to whatever status code is appropriate.

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
Bhuwan08
Level 2

Likes

8 likes

Total Posts

13 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 2
Bhuwan08
Level 2

Likes

8 likes

Total Posts

13 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Affirm 1
View profile
Bhuwan08
Level 2

01-07-2020