Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Removing /content/project from URL

Avatar

Level 3

Hy Guys,

I was trying to remove the "/content/project" from URL.

I've configured on the Apache Sling Resource Resolver Factory in the URL Mappings field.

1700906_pastedImage_2.png

When I'm accessing the URL http://localhost:4502/content/ATT/en.html it was returning 200, but when I'm accessing the URL http://localhost:4502/en.html it was returning 404.

Does anyone have an opinion about that configuration?

Thanks

Alisson Xavier

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

you can make use of sling:internalredirect as described in below article:

Resource Mapping

so suppose if my url is http://localhost:4502/content/foxtel/login.html

http://localhost:4502/content/project/login.html

then it will change it http://localhost:4502/login.html

check if that works for you.

~ Prince

View solution in original post

4 Replies

Avatar

Correct answer by
Community Advisor

you can make use of sling:internalredirect as described in below article:

Resource Mapping

so suppose if my url is http://localhost:4502/content/foxtel/login.html

http://localhost:4502/content/project/login.html

then it will change it http://localhost:4502/login.html

check if that works for you.

~ Prince

Avatar

Level 3

Another question.

Can I configure this on the dispatcher also?

Avatar

Level 10

You can configure it "apache" via mod_rewrite  - mod_rewrite - Apache HTTP Server Version 2.4

E.g.    RedirectMatch ^/en.html$ /content/ATT/en.html [PT,L]