Interlink Issue of the website content | Community
Skip to main content
August 8, 2023
Solved

Interlink Issue of the website content

  • August 8, 2023
  • 3 replies
  • 919 views

I have content page test-define.html hosted on AEM whose url is (example) www.test.in/test-define but this can also be accessed using www.test.in/test-define.mnbbbbbbvfghj or https://www.test.in/content/test-website/language-masters/en/test1/test1-India/home/test-define.html. The issue exist on both stage and prod environment. How to rectify it?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jagadeesh_Prakash

@_groovy  can you check from your filter.any file if you have any specfic rules to allow * selectors in the url for ex: it should not below like *.*.html

/0014 { /type "allow" /method "POST" /url "/content/*.*.html" } # allow POSTs to form selectors under content

 

And also you need to write the custom rewrite rules to shoten the url 

 

#Shorten the URL
RewriteRule ^/content/${CONTENT_FOLDER_NAME}/(.*).html$ $1.html [R,L]

 

 

3 replies

Jagadeesh_Prakash
Community Advisor
Jagadeesh_PrakashCommunity AdvisorAccepted solution
Community Advisor
August 8, 2023

@_groovy  can you check from your filter.any file if you have any specfic rules to allow * selectors in the url for ex: it should not below like *.*.html

/0014 { /type "allow" /method "POST" /url "/content/*.*.html" } # allow POSTs to form selectors under content

 

And also you need to write the custom rewrite rules to shoten the url 

 

#Shorten the URL
RewriteRule ^/content/${CONTENT_FOLDER_NAME}/(.*).html$ $1.html [R,L]

 

 

aanchal-sikka
Community Advisor
Community Advisor
August 8, 2023

@_groovy

 

 https://www.test.in/content/test-website/language-masters/en/test1/test1-India/home/test-define.html.  can be fixed by defining proper filter rules in dispatcher.

 

/0100 { /type "deny" /extension "html" /path "/content/test-website/*" }

 

Similarly for www.test.in/test-define.mnbbbbbbvfghj

Deny all access. Then allow based on selectors and extensions

/0251 { /type "allow" /selectors "abc" /extension "json" /path "/content/test-website/*" }

 

 

Aanchal Sikka
EstebanBustamante
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
August 8, 2023

It seems that the question is incomplete. Could you clarify what you are aiming to rectify or achieve? What specific requirements do you have in mind? If you are referring to shortening URLs and preventing the use of certain selectors, then I believe the answers are quite self-explanatory.

  1. You should block any other selectors that you deem inappropriate.

  2. You have the option to incorporate a RewriteCond to abbreviate and reconstruct the complete AEM path.

Both of these situations are already handled by default in the AEM Project Archetype, so I suggest you review the following resource as a guideline:

https://github.com/adobe/aem-project-archetype/blob/e7b2480f599e210230a3a631eaa0df1c5a7f7d44/src/main/archetype/dispatcher.cloud/src/conf.dispatcher.d/filters/default_filters.any#L11 

https://github.com/adobe/aem-project-archetype/blob/e7b2480f599e210230a3a631eaa0df1c5a7f7d44/src/main/archetype/dispatcher.cloud/src/conf.d/rewrites/rewrite.rules#L11 

 

Hopefully, this helps.

Esteban Bustamante
_groovyAuthor
August 9, 2023

Aim is to nullify all the gibberish urls and accept only  Example: http://www.test.in/test-define (consider this url is for live environment)