Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

How to make case in sensitive url in AEM 6.1

Avatar

Level 2

Hi,

 

can you please let me know is there a way to make AEM url as case in sensitive. I need to allow both of the below urls.

 

http://mywebsite.com/content/home.html

http://mywebsite.com/content/homE.html

 

Thanks

Sam

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi 

Please have a look at this article:-

Link:- https://www.w3.org/TR/WD-html40-970708/htmlweb.html

//According to W3's "HTML and URLs" they should: There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.

All “insensitive”s are boldened for readability.

Domain names are case insensitive according to RFC 4343. The rest of URL is sent to the server via the GET/PUT method. This may be case sensitive or not.

Take this page for example, stackoverflow.com recieves GET string /questions/7996919/should-url-be-case-sensitive, sending a HTML document to your browser. Stackoverflow.com is case insensitive because it produces the same result for /QUEStions/7996919/Should-url-be-case-sensitive.

On the other hand, Wikipedia is case sensitive except the first character of the title. The URLs https://en.wikipedia.org/wiki/Case_sensitivity and https://en.wikipedia.org/wiki/case_sensitivity leads to the same article, but https://en.wikipedia.org/wiki/CASE_SENSITIVITY returns 404.

 

As Gorg stated, it is not possible directly via AEM and it is also not the Best practices.

 

In Apache, 

In .htaccess

<IfModule mod_speling.c>
CheckSpelling on
</IfModule>
Tested, works, if you have the mod_speling enabled.

Or, in a serverwide httpd.conf:

RewriteEngine On
RewriteMap  lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

 

I hope this will help you.

~kautuk

View solution in original post

0 Replies

Avatar

Level 10

Explore Sling Mapping for this and possibility the use of wildcards:

https://docs.adobe.com/docs/en/cq/5-6-1/deploying/resource_mapping.html

Try with "(?i)[^/]+/content/site1/page1.html"
This should match page1, Page1, PAGE1 etc..

Avatar

Employee Advisor

Hi,

I don't think that this is possible. Also I don't see a good reason why one would have such a feature enabled.

Jörg

Avatar

Correct answer by
Administrator

Hi 

Please have a look at this article:-

Link:- https://www.w3.org/TR/WD-html40-970708/htmlweb.html

//According to W3's "HTML and URLs" they should: There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.

All “insensitive”s are boldened for readability.

Domain names are case insensitive according to RFC 4343. The rest of URL is sent to the server via the GET/PUT method. This may be case sensitive or not.

Take this page for example, stackoverflow.com recieves GET string /questions/7996919/should-url-be-case-sensitive, sending a HTML document to your browser. Stackoverflow.com is case insensitive because it produces the same result for /QUEStions/7996919/Should-url-be-case-sensitive.

On the other hand, Wikipedia is case sensitive except the first character of the title. The URLs https://en.wikipedia.org/wiki/Case_sensitivity and https://en.wikipedia.org/wiki/case_sensitivity leads to the same article, but https://en.wikipedia.org/wiki/CASE_SENSITIVITY returns 404.

 

As Gorg stated, it is not possible directly via AEM and it is also not the Best practices.

 

In Apache, 

In .htaccess

<IfModule mod_speling.c>
CheckSpelling on
</IfModule>
Tested, works, if you have the mod_speling enabled.

Or, in a serverwide httpd.conf:

RewriteEngine On
RewriteMap  lc int:tolower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

 

I hope this will help you.

~kautuk