Hello,
I have set the Redirect path from page properties,
So, once I hit the page: http://localhost:4503/content/we-retail/us/en/about-us.html
it properly redirects me to the https://www.google.com/
But the issue is when I added a selector with URL, http://localhost:4503/content/we-retail/us/en/about-us.test.html
it instead of a 301 redirect, it shows me the actual About Us page.
How to make it work, when I have any selector with the URL.
Solved! Go to Solution.
Views
Replies
Total Likes
The dispatcher-related solutions won't work for me because my use case is dealing with lot of pages and not a static pattern.
Now, for redirect, I wrote Cloudflare worker and it will be synced periodically with AEM.
Hi @Sady_Rifat ,
Not sure about your use case but if list is limited and redirection are fixed we can redirect from dispatcher itself. Also it will help to off load the publish instance.
RewriteRule ^/contactus https://corp.exampleco.com/contactus.html [NC,R=301]
I have seen hard coded redirect for legacy Urls from dispatcher to maintain seo.
Thanks
No, the redirection is not fixed, also in the real case, all my requests have a selector that contains the Country code from the cookie with the URL.
Views
Replies
Total Likes
Hi @Sady_Rifat
Vanity URLs or Redirect URLs in page properties are best suited for simple, static redirections and should not be relied on for complex scenarios involving selectors.
Solution:
Dispatcher Rewrite Rules: Update Apache rules to include selectors. Example:
RewriteCond %{REQUEST_URI} ^/content/page\.selector\.html$
RewriteRule ^(.*)$ /new-path [R=301,L]
Sling Mappings: Add mappings in /etc/map to handle selectors in AEM.
ACS Commons Redirect Manager: Use this tool to manage redirects involving selectors via a UI.
Regards,
In reality, all my requests have a selector containing the country code from the cookie with the URL.
So, in my understanding the default Redirection will be helpful for my case.
Views
Replies
Total Likes
By default all selectors are denied in dispatcher filter, unless specified.
If you do not want this selector called "test", deny it in filter. If you do not want selectors for this page, deny selector for this page.
To fix the redirect issue with selectors:
These steps will ensure proper 301 redirects even with selectors in the URL.
The dispatcher-related solutions won't work for me because my use case is dealing with lot of pages and not a static pattern.
Now, for redirect, I wrote Cloudflare worker and it will be synced periodically with AEM.
Views
Likes
Replies