Hello community,
Top of the list of 404's listed on Google Console is an inbound link to our site from an external site. Is there any way using AEM redirect manager (ideally) to create a redirect to a different destination to correct the wrong url applied on this external site? The url path doesn't even exist on our site so applying the backend authoring view format to locate page in AEM can't apply?
If this situation can be fixed, I would be grateful if you could define the format - do I apply for instance the full url (https://...) as redirecting from and apply similarly the full url to new destination or otherwise the AEMauthoring view path?
Yesterday, I applied both format instances for the destination url but this doesn't seem (yet) to be working.
Any advice greatly appreciated, thank you.
Hi @Alex9463
Yes, you can write redirect in AEM either using AEM Redirect manager or directly at dispatcher/CDN.
E.g. https://www.mysite.com/path-does-not-exists to https://www.mysite.com/new-path with 301
RewriteRule ^path-does-not-exists/?$ https://www.mysite.com/new-path [R=301,L]
Hi @Alex9463 ,
In this case I suggest you to go for the redirect rule in AEM Dispatcher (even in a CDN if the CDN is present in front of your origin server).
For the format you can use full URL if the destination URL is external URL, if the URL's are internal go with short URL.
Procedure for Dispatcher redirect rule :-
1. The redirect file can be found at the following location in dispatcher
Path :- /etc/httpd/conf.d/rewrites/abc.mydomain.com.redirects.conf
2. Create a redirect rule
Rule :-
RewriteRule ^/en/home/deactivated-page.html$ /en/home.html [R=301,L]
3. Redirect rule writing procedure
Open the redirect file with vi command giving full path
vi /etc/httpd/conf.d/rewrites/abc.mydomain.com.redirects.conf
Ones the file is open go to the Insert mode by pressing "i". paste the rule at the beginning of the file. press "Esc" to come out of the insert mode.
to write the file use following command (case sensitive)
:w!
ones the file is written to close the file use
:q
check the syntax in dispatcher if it is okay.
apachectl configtest
if the syntax is okay reload the dispatcher
sudo /bin/systemctl reload httpd
after the restart hit the faulty url in the incognito mode you will able to get redirected to the new URL.
I hope this helps.
There are 2 possible ways to deal with this
1. Use AEM Redirect Manager (if available)
If you're using AEM Sites with the Redirect Map UI (common in AEMaaCS or with the ACS Commons Redirect Map Manager), follow this format:
Format for Redirect Entry
Source (redirect from): use the path, not domain
Eg: /wrong-link-path
Target (redirect to):
Either: a full path like /content/mysite/en/correct-page.html (works best if target is a page)
or an external full URL (e.g. https://www.xyz.com/home)
2. Use Apache Dispatcher Rewrite Rules (Reliable Fallback)
If Redirect Manager is not available or too slow to propagate:
In your Apache HTTP Server (Dispatcher), add this rewrite in rewrite.rules.
Eg: RewriteRule ^/wrong-link-path$ /new-page.html [R=301,L]
This works instantly on Dispatcher level and fixes SEO 404s.
Views
Likes
Replies
Views
Likes
Replies