Https Redirect issue | Community
Skip to main content
May 25, 2021
Solved

Https Redirect issue

  • May 25, 2021
  • 3 replies
  • 1298 views

We have added a redirect in dispatcher  /abc.html to /xyz.html. 

When https://www.example.com/abc.html is accessed

Actual behaviour:

https://www.example.com/abc.html --> http://www.example.com/xyz.html --> https://www.example.com/xyz.com 

 

Expected Behaviour:

https://www.example.com/abc.html --> https://www.example.com/xyz.html

 

Configuration in Dispatcher:

      RewriteCond %{HTTP:X-Forwarded-Proto} !https

      RewriteCond %{HTTPS} !=on

      RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

 

How to remove the https to http redirect? Is there any other configuration needs to be added in dispatcher?

 

 

 

 

 

 

 

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by MarkusBullaAdobe

Hi @karthikn!

Unfortunately, the provided information is not sufficient to give a lot of advice here.

The shared snippet from your dispatcher configuration takes care of redirecting insecure incoming requests (http) to secure ones (https) and does not seem to be related to the issue you're describing.

 

Please double check on your rewrite rules and make sure that your are preserving the protocol as HTTPS during the redirect from "abc" to "xyz". If you need additional support on that, please share your according rewrite rules. There may also be other rules interfering with your intended behavior, sometimes even at different layers (e. g. AEM instance or load balancer instead of Dispatcher) of the stack. So maybe set your log levels to debug and check dispatcher logs for further analysis.

 

Hope that helps!

3 replies

MarkusBullaAdobe
Adobe Employee
MarkusBullaAdobeAdobe EmployeeAccepted solution
Adobe Employee
May 25, 2021

Hi @karthikn!

Unfortunately, the provided information is not sufficient to give a lot of advice here.

The shared snippet from your dispatcher configuration takes care of redirecting insecure incoming requests (http) to secure ones (https) and does not seem to be related to the issue you're describing.

 

Please double check on your rewrite rules and make sure that your are preserving the protocol as HTTPS during the redirect from "abc" to "xyz". If you need additional support on that, please share your according rewrite rules. There may also be other rules interfering with your intended behavior, sometimes even at different layers (e. g. AEM instance or load balancer instead of Dispatcher) of the stack. So maybe set your log levels to debug and check dispatcher logs for further analysis.

 

Hope that helps!

arunpatidar
Community Advisor
Community Advisor
May 25, 2021

Hi,

Can you check your redirect rules?

 

RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE] RewriteRule ^abc.html /xyz.html [R=302,L]

 

Arun Patidar
Asutosh_Jena_
Community Advisor
Community Advisor
May 25, 2021

Hi @karthikn 

 

Put the below rule at the begining of the file.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/+$ $1 [R=302,L]

Try after that.

RewriteRule ^/abc.html$ /xyz.html [R=302,L]