Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Sling:alias redirect 301

Avatar

Level 3

I have a page(http://localhost:4502/content/page/test.html) for which 301 redirect has been set using the redirect manager, in this page we added the alias property(testingalias) under advanced tab. Now the redirect is working for the page(https://www.test.com/page/test.html) but not for the alias URL(https://www.test.com/page/testingalias.html). Is this expected or we should set 301 redirect for the alias as well?

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@nivethaS 

 

If your goal is redirection from /page1.html to /page1-alias.html, then you should use the Rewrite Rule directive:

RewriteRule /page1.html /page1-alias.html [R=301,L] - for 301 redirect (the path shown in browser will be /page1-alias.html) or

RewriteRule /page1.html /page1-alias.html [PT] (the path shown in browser will be /page1.html)

 

 

https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewriterule
https://httpd.apache.org/docs/2.4/rewrite/flags.html

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

@nivethaS 

 

If your goal is redirection from /page1.html to /page1-alias.html, then you should use the Rewrite Rule directive:

RewriteRule /page1.html /page1-alias.html [R=301,L] - for 301 redirect (the path shown in browser will be /page1-alias.html) or

RewriteRule /page1.html /page1-alias.html [PT] (the path shown in browser will be /page1.html)

 

 

https://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewriterule
https://httpd.apache.org/docs/2.4/rewrite/flags.html