Expand my Community achievements bar.

SOLVED

URL rewrite/shortening not working in Dispatcher

Avatar

Level 2

When I use PT or L flag, my URL shortening is not working. It only works with R flag. R flag is for URL redirecting, but I need internal rewrite. I am using apache 2.2 on Linux. I have mode_rewrite.so and mod_proxy.so in my modules directory.

RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/content/dam 
RewriteRule ^/(.*) /content/dam/$1 [L]

I am trying to shorten URL from 

http://serverx.epga.nam.com:15100/content/dam/parts/images/22787711_Primary.jpg

to 

http://serverx.epga.nam.com:15100/parts/images/22787711_Primary.jpg

1 Accepted Solution

Avatar

Correct answer by
Employee

Hi,

typically, the user would enter the shortened URL: http://serverx.epga.nam.com:15100/parts/images/22787711_Primary.jpg which would then get rewritten to the full path in Dispatcher: /content/dam/parts/images/22787711_Primary.jpg this expanded URL would then be passed onto AEM (if it was not already cached)

Shortening URL's from /content/dam/parts/images/22787711_Primary.jpg to /parts/images/22787711_Primary.jpg is done during rendering

Also check your dispatcher log file, you can increase the level of logging to get more details.

Regards,

Opkar

View solution in original post

3 Replies

Avatar

Level 9

Hi Vishal,

Here are the very nice docs which explain each & every in details. Try below rule if it solves your problem.

http://serverfault.com/questions/214512/redirect-change-urls-or-redirect-http-to-https-in-apache-eve...

https://httpd.apache.org/docs/2.2/rewrite/flags.html

RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/content/dam 
RewriteRule ^/(.*)$  /content/dam/$1 [L]

Jitendra

Avatar

Administrator

[EDITED]

Hi 

Some reference links to start with :-

Link:- https://docs.adobe.com/docs/en/dispatcher/disp-domains.html#AEM Rewrites Incoming URLs

file

The Dispatcher cache mirrors the repository node structure. Therefore, when page activations occur  the resulting requests for invalditing the cached page require no URL or path translations. 

file

Link:- http://stackoverflow.com/questions/21662780/how-sling-rewriter-works-clarification

Link:- https://www.cognifide.com/our-blogs/cq/multidomain-cq-mappings-and-apache-configuration/

// This post is intended to serve as a quick referecnce document wherein you can learn how to configure 3 language versions of the well-known Geometrixx site to work on 3 domains: geometrixx.com, geometrixx.de and geometrixx.fr

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Correct answer by
Employee

Hi,

typically, the user would enter the shortened URL: http://serverx.epga.nam.com:15100/parts/images/22787711_Primary.jpg which would then get rewritten to the full path in Dispatcher: /content/dam/parts/images/22787711_Primary.jpg this expanded URL would then be passed onto AEM (if it was not already cached)

Shortening URL's from /content/dam/parts/images/22787711_Primary.jpg to /parts/images/22787711_Primary.jpg is done during rendering

Also check your dispatcher log file, you can increase the level of logging to get more details.

Regards,

Opkar