AEM 6.3: Getting 403 error on dispatcher and blank page
Hi,
I have configured Apache web server and dispatcher. Here are the rewrite rules:
RewriteRule ^/$ /content/aemsite/en.html [PT,L]
RewriteCond %{REQUEST_URI} ^/content
RewriteCond %{REQUEST_URI} !^/content/campaigns
RewriteCond %{REQUEST_URI} !^/content/dam
RewriteRule !^/content/aemsite/en - [R=404,L,NC]
RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
RewriteRule ^/(.*)$ /content/aemsite/en/$1 [PT,L]
I have also configured sling mappings:
{
"jcr:primaryType": "sling:Mapping",
"www_aemsite_com": {
"sling:internalRedirect": [
"/content/aemsite/en.html"
],
"jcr:primaryType": "sling:Mapping",
"sling:match": "www.aemsite.com/$"
},
"www.aemsite.com": {
"sling:internalRedirect": [
"/content/aemsite/en",
"/"
],
"jcr:primaryType": "sling:Mapping"
}
}
and I have also configured "Day CQ Link Checker Transformer" to strip HTML extension:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:OsgiConfig"
linkcheckertransformer.strictExtensionCheck="{Boolean}false"
linkcheckertransformer.rewriteElements="[a:href,area:href,form:action]"
linkcheckertransformer.disableRewriting="{Boolean}false"
linkcheckertransformer.disableChecking="{Boolean}false"
linkcheckertransformer.stripHtmltExtension="{Boolean}true"
linkcheckertransformer.mapCacheSize="{Long}5000"/>
A trailing slash gets appended to the URL. For example, a link that points to http://www.aemsite.com/articles has the "/" appended and I see a blank page. In the logs I see a 403 on web server level while trying to access the pages under http://www.aemsite.com/ as shown below.
127.0.0.1 - - [09/Mar/2018:22:26:44 -0500] "GET /articles HTTP/1.1" 302
127.0.0.1 - - [09/Mar/2018:22:26:44 -0500] "GET /articles/ HTTP/1.1" 403 1
How can I make sure that http://www.aemsite.com/articles gets redirected to http://www.aemsite.com/articles.html internally?
Thanks in advance