Can redirect a page to a page with alias name?

Avatar

Avatar

gayatrik8153299

Avatar

gayatrik8153299

gayatrik8153299

25-08-2020

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.

 

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Andrei_Dantsou

Avatar

Andrei_Dantsou

Andrei_Dantsou

25-08-2020

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

Answers (4)

Answers (4)

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831

Avatar

Arun_Patidar

MVP

Total Posts

2.9K

Likes

1.0K

Correct Answer

831
Arun_Patidar
MVP

25-08-2020

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

Avatar

Avatar

harishv63553358

Avatar

harishv63553358

harishv63553358

25-08-2020

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...

Avatar

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K

Avatar

Jörg_Hoh

Employee

Total Posts

3.0K

Likes

910

Correct Answer

1.0K
Jörg_Hoh
Employee

25-08-2020

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

Avatar

Nikhil-Kumar

MVP

Avatar

Nikhil-Kumar

MVP

Nikhil-Kumar
MVP

25-08-2020