Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Can redirect a page to a page with alias name?

Avatar

Level 2

Hi All,

We have a page where we have configured the alias name but page is not redirecting with alias name.

We are using AEM 6.4.5 version

Ex: page1 has configured alias name as page1-alias

when we hit the page with /page1.html it should redirect to /page1-alias.html but its not working.

We tried clearing the dispatcher cache and provided the root level access to anonymous user as well but still not working.

But when we direct hit the alias page is working(/page1-alias.html)

Could you please let us know whether can redirect a page to a page with alias name.

 

1 Accepted Solution

Avatar

Correct answer by
Level 4

Hello @gayatrik8153299 ,

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

The alias in the "Page Properties > Advanced" makes the page accessible via the different name. For instance if the alias for the page /content/we-retail/language-masters/en/experience/skitouring.html is set to "skitouring-alias", then the page will accessible via the /content/we-retail/language-masters/en/experience/skitouring-alias.html url as well, so the behavior you've described appears to be expected.

Regards

View solution in original post

6 Replies

Avatar

Correct answer by
Level 4

Hello @gayatrik8153299 ,

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

The alias in the "Page Properties > Advanced" makes the page accessible via the different name. For instance if the alias for the page /content/we-retail/language-masters/en/experience/skitouring.html is set to "skitouring-alias", then the page will accessible via the /content/we-retail/language-masters/en/experience/skitouring-alias.html url as well, so the behavior you've described appears to be expected.

Regards

Avatar

Employee Advisor
@andrei_Dentsou: in that case you do a static rewrite to ${pagename}-alias, which is probably not what the poster wants to achieve. Also just rewriting the URL on incoming requests does not render any link to ${pagename} as ${pagename}-alias.html, but you just rewrite it on the connection between dispatcher and AEM.

Avatar

Community Advisor

Addition to Andrei_Dantsou

You can try using vanity URLs with redirect vanity url property to redirect user to different page. but check below post before using vanity urls

https://blog.3sharecorp.com/enabling-vanity-urls-with-adobe-experience-manager



Arun Patidar

Avatar

Employee Advisor

Hi,

So you want that if you specify page1.html as target page, the alias value is used instead of the page name (if the alias is configured)? IIRC that's not default, but it should be doable using a custom rewriter.

Avatar

Level 2

hi @gayatrik8153299 small tip, usually we get these kind of issues with vanity conflicts. Please double check. 

You can use this package to fetch all the vanity list on your instance. https://downloads.experiencecloud.adobe.com/content/software-distribution/en/pswelcome.html?packageP...