Hi AEM Community,
I have a domain name "xyz" which I want to redirect to my homepage in AEM.
I have done the below -
1. Defined VHost File as below -
<IfModule mod_rewrite.c>
RewriteEngine On
Include conf.d/rewrites/rewrite.rules
# Add .html extension when extension is missing from request
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]*[^./])$ $1.html [R=301,L]
<LocationMatch "^\/content\/dam.*\.(pdf|jpe?g|png|gif|txt|xml).*">
Header unset "Content-Disposition"
Header set Content-Disposition inline
</LocationMatch>
# custom rewrites
#Redirect Root page request to home page
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) /content/xyz/us/en/home-page.html [PT,L]
# rewrite for root redirect - Alternative
# RewriteRule ^/?$ /content/xyz/us/en/home-page.html [R=302,L]
</IfModule>
I wrote the above rule in my vhost file but get the below error log in dispatcher
172.17.0.1 "xyz:8080" - [27/Jul/2022:11:40:29 +0000] "GET / HTTP/1.1" 404 5615 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0"
[27/Jul/2022:11:40:29 +0000] "GET /content/xyz/us/en/errors/404.html HTTP/1.1" - hit [publishfarm/-] 15ms "xyz:8080"
I have defined an Error Document directive too as below -
ErrorDocument 404 /content/xyz/us/en/errors/404.html
Can you help as to why the redirect is not working ?
The root is getting mapped directly to the ErrorDocument Directive.
Likes
Total Posts
Correct reply
Jörg_Hoh Any quick help on this ?
Solved! Go to Solution.