Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session
SOLVED

Interlink Issue of the website content

Avatar

Level 1

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?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

@_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]

 

 

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

@_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]

 

 

Avatar

Community Advisor

@_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

Avatar

Community Advisor

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/mai... 

https://github.com/adobe/aem-project-archetype/blob/e7b2480f599e210230a3a631eaa0df1c5a7f7d44/src/mai... 

 

Hopefully, this helps.



Esteban Bustamante

Avatar

Level 1

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)