Access /content blocking in browser
Hi, everyone!
I'll put a little bit in situation, we have a project under the path /content/espacio-comunicaciones, let's put as an example a page of this project that is hosted in AEM in /content/espacio-comunicaciones/es/home. On this project, we have already implemented that if a user accesses in his browser to https://<domain>/es/home.html, it redirects internally to the path of /content/espacio-comunicaciones/es/home mentioned before, invisible redirection for the user but showing the page correctly. Now, if the user instead of using that path, searches for https://<domain>/content/espacio-comunicaciones/es/home.html, the page is also displayed in the browser.
This last case is the one we have been asked to change, they want that if a user tries to access the page using the /content path, it is blocked and gives an error.
I have tried some things in dispatcher but none of them has helped me:
1. Blocking the searches with path /content/espacio-comunicaciones and returning a 404 in that case, the problem with this way is that, although the pages searched with /content are blocked and the ones searched without the /content are shown, the queries that try to access /content stop working and therefore, the components that use them give error in the pages. The code I used for this case, in the .rules for that project, was the following:
RewriteCond %{REQUEST_URI} ^/(content/espacio-comunicaciones) [NC]
RewriteRule ^ - [R=404,L]
2. The next two tests I did were similar to each other, I just changed /path to /url in the line below. In the filters for that project I added a deny to block the /content/espacio-comunicaciones path, the problem is that this blocking seems to be done after internally AEM has converted the searched path by the internal one, since when searching for pages with https://<domain>/es/home.html (without entering the path with the /content) they are also blocked. I didn't know if /url and /path had any difference in that but it seems not, with both the same thing happens. Then I read in the forum that with /url you don't have to put the /extension but honestly, even if I remove that, I don't think it will work for what I'm looking for (since it also blocked everything). This is the line of code (also with /url instead of /path):
/deny_content_url { /type "deny" /extension '(html)' /path "/content/espacio-comunicaciones/*" }
Do you know of a way to block the pages searched directly with path /content, but without blocking the pages searched by domain and without stopping the queries and internal calls to /content that AEM makes?
Thanks in advance,
Paula
