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
BedrockMission!

Learn More

View all

Sign in to view all badges

Https Redirect issue

Avatar

Avatar
Level 1
karthikn
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
karthikn
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
karthikn
Level 1

25-05-2021

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?

 

 

 

 

 

 

 

 

AEM 6.5 aem dispatcher

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 100
Employee
markus_bulla_adobe
Employee

Likes

110 likes

Total Posts

89 posts

Correct Reply

46 solutions
Top badges earned
Boost 100
Applaud 25
Affirm 25
Boost 50
Boost 25
View profile

Avatar
Boost 100
Employee
markus_bulla_adobe
Employee

Likes

110 likes

Total Posts

89 posts

Correct Reply

46 solutions
Top badges earned
Boost 100
Applaud 25
Affirm 25
Boost 50
Boost 25
View profile
markus_bulla_adobe
Employee

25-05-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!

Answers (2)

Answers (2)

Avatar

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile

Avatar
Give Back 100
Level 10
asutosh_jena
Level 10

Likes

559 likes

Total Posts

676 posts

Correct Reply

194 solutions
Top badges earned
Give Back 100
Boost 500
Affirm 100
Ignite 1
Establish
View profile
asutosh_jena
Level 10

25-05-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] 

 

Avatar

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile

Avatar
Coach
MVP
Arun_Patidar
MVP

Likes

1,356 likes

Total Posts

3,227 posts

Correct Reply

917 solutions
Top badges earned
Coach
Contributor 2
Ignite 10
Give Back 700
Boost 1000
View profile
Arun_Patidar
MVP

25-05-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]