Hi all,
I have issue that is regarding a redirect from www to a non www site (i.e http$://www.domain.com to http$://domain.com). I know this can be done using sling mapping in /etc/map but faster accessing i wants this done at the dispatcher level according to AEM best practices. This is for an AEM as a Cloud Service instance.
Thanks
Nandheswara
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @Nandheswara This can be easily achieved you using the Rewrite Rules that can be written at the path \dispatcher\src\conf.d\rewrites
Samples file can be found at
Reference for writting rewrite rules -
You can try this, if this works directly
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Hope this helps!
Thanks
@Nandheswara can you try below code in your dispatcher filter code
/filter
{
...
/redirect
{
/glob "*"
/type "redirect"
/redirect "https://example.com{URL}"
/redirectCode "301"
/reason "Permanent Redirect"
/globbing "wildcard"
}
...
}
Hi @Nandheswara This can be easily achieved you using the Rewrite Rules that can be written at the path \dispatcher\src\conf.d\rewrites
Samples file can be found at
Reference for writting rewrite rules -
You can try this, if this works directly
RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Hope this helps!
Thanks
@Nandheswara solutions suggested by others should work.. but I would recommend todo this redirect at CDN level instead of dispatcher level.. as always redirects have to be configured as close to edge as possible...
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies