Expand my Community achievements bar.

Manage Redirects not working for space or parenthesis

Avatar

Level 4

Hi, would like to ask about the Manage Redirects.
we have a Source URL something like this
/content/<path>/<path>/<path>/filename (1).pdf

And it should redirect to 
{domain}/content/<path>/<path>/<path>/filename.pdf#zoom=25

I've tried similar approach to this one:
https://github.com/Adobe-Consulting-Services/acs-aem-commons/issues/2702#issuecomment-996704867
In which I converted the 'space' to underscore or hyphen via Dispatcher.
And tried adding rule to Manage Redirect 
/content/<path>/<path>/<path>/filename-(1).pdf
to
{domain}/content/<path>/<path>/<path>/filename.pdf#zoom=25

But it seems that it is not working.
What could be the possible approach or fix for this one.

Thanks!

4 Replies

Avatar

Community Advisor

Can you try with below rule

# Replace %20 with hyphen
RewriteRule ^(.*)\%20(.*)$ $1-$2 [N,E=redirected:1] 



Arun Patidar

Avatar

Level 4

I already have that on the rule:
In which I converted the 'space' to underscore or hyphen via Dispatcher.
Now, my problem are the next steps after that.

 

Avatar

Level 4

Additional question, if those spaces where to convert to hyphen, would it automatically point to the resource that we are pointing to? Or theres a different case for the parenthesis present on the file?
Thanks!

 

Avatar

Community Advisor

No, It won't. You have to write reverse mapping as well in dispatcher/AEM to map those paths.



Arun Patidar