AEM Dispatcher post servlet is converting to GET | Community
Skip to main content
Level 6
May 29, 2023

AEM Dispatcher post servlet is converting to GET

  • May 29, 2023
  • 3 replies
  • 1526 views

AEM dispatcher, after the shortening of URL via POSTMAN is giving 409 status, and on dispatcher URL, it is converting POST call to GET call

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

3 replies

MayurSatav
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
May 29, 2023

hi @ronnie09 ,

 

The HTTP status code 409 indicates a conflict, which typically occurs when there is a conflict between the request being made and the current state of the resource. A 409 status code could indicate a conflict with the URL shortening configuration or a misconfiguration in the Dispatcher setup.

 

Review the logs on the Dispatcher server to identify any error messages or warnings related to the URL shortening functionality. The logs may provide additional details about the cause of the conflict.

Ronnie09Author
Level 6
May 29, 2023

@mayursatav 
Below is my dispatcher config couldn't find anything on log


<IfModule mod_rewrite.c>
RewriteEngine on
 
    # rewrite for load root page
    RewriteCond %{HTTP_HOST} !^localhost    
    RewriteRule ^/?$ http://%{ENV:SAMPLE_HOST_PREFIX}%{HTTP_HOST}/us/en/home.html [R=301,L]
 
   
    # rewrite for redirect wrong links that beginning with '/content/sample'
    RewriteRule ^/content/sample/(.*) /$1 [E=SAMPLE_REDIRECT:1,NC]
 
    # rewrite for redirect wrong links that ending with extension '.html'
    RewriteCond %{HTTP_HOST} !^localhost    
    RewriteCond %{REQUEST_URI} !^/libs
    RewriteRule ^(.*)\.html$ $1 [E=SAMPLE_REDIRECT:1,N,NC]
 
    # rewrite for redirect wrong links that ending with '/'
    RewriteCond %{HTTP_HOST} !^localhost    
    RewriteRule ^(.*)/$ $1 [E=SAMPLE_REDIRECT:1,N]
 
    RewriteCond  %{ENV:SAMPLE_REDIRECT} "=1" [OR]
    #RewriteCond  %{ENV:SAMPLE_HOST_PREFIX} "=www." [OR]
    RewriteCond  %{ENV:SAMPLE_HTTPS} "=1"
    RewriteCond  %{REQUEST_URI} !^/dispatcher/invalidate.cache$
    RewriteRule ^(.*)$ http://%{ENV:SAMPLE_HOST_PREFIX}%{HTTP_HOST}$1 [R=301,L]
 
    RewriteCond %{REQUEST_URI} !^/apps
    RewriteCond %{REQUEST_URI} !^/bin
    RewriteCond %{REQUEST_URI} !^/content
    RewriteCond %{REQUEST_URI} !^/etc
    RewriteCond %{REQUEST_URI} !^/home
    RewriteCond %{REQUEST_URI} !^/libs
    RewriteCond %{REQUEST_URI} !^/saml_login
    RewriteCond %{REQUEST_URI} !^/system
    RewriteCond %{REQUEST_URI} !^/tmp
    RewriteCond %{REQUEST_URI} !^/var
    RewriteCond %{REQUEST_URI} \.(jpe?g|png|svg|json|form)$
    RewriteRule ^/(.*)$ /content/sample/$1 [PT,L]
 
    RewriteCond %{REQUEST_URI} !^/content/ [NC]
    RewriteCond %{REQUEST_URI} !^/etc.clientlibs [NC]
    RewriteCond %{REQUEST_URI} !^/bin [NC]
    RewriteCond %{REQUEST_URI} !^/libs
    RewriteCond %{REQUEST_URI} !\.(.+)$
    #/ar-us
    RewriteRule ^/([^\?]*)(.*)$ /content/sample/$1.html$2 [PT,L]
</IfModule>
rawvarun
Community Advisor
Community Advisor
May 29, 2023

Check shortened URL and see if it conflicts with any rule in the dispatcher.

Also, see the dispatcher as well as AEM logs for any errors.

Ronnie09Author
Level 6
May 29, 2023

@rawvarun 
GET requests are working fine issue is only with post

 

<IfModule mod_rewrite.c> RewriteEngine on # rewrite for load root page RewriteCond %{HTTP_HOST} !^localhost RewriteRule ^/?$ http://%{ENV:SAMPLE_HOST_PREFIX}%{HTTP_HOST}/us/en/home.html [R=301,L] # rewrite for redirect wrong links that beginning with '/content/sample' RewriteRule ^/content/sample/(.*) /$1 [E=SAMPLE_REDIRECT:1,NC] # rewrite for redirect wrong links that ending with extension '.html' RewriteCond %{HTTP_HOST} !^localhost RewriteCond %{REQUEST_URI} !^/libs RewriteRule ^(.*)\.html$ $1 [E=SAMPLE_REDIRECT:1,N,NC] # rewrite for redirect wrong links that ending with '/' RewriteCond %{HTTP_HOST} !^localhost RewriteRule ^(.*)/$ $1 [E=SAMPLE_REDIRECT:1,N] RewriteCond %{ENV:SAMPLE_REDIRECT} "=1" [OR] #RewriteCond %{ENV:SAMPLE_HOST_PREFIX} "=www." [OR] RewriteCond %{ENV:SAMPLE_HTTPS} "=1" RewriteCond %{REQUEST_URI} !^/dispatcher/invalidate.cache$ RewriteRule ^(.*)$ http://%{ENV:SAMPLE_HOST_PREFIX}%{HTTP_HOST}$1 [R=301,L] RewriteCond %{REQUEST_URI} !^/apps RewriteCond %{REQUEST_URI} !^/bin RewriteCond %{REQUEST_URI} !^/content RewriteCond %{REQUEST_URI} !^/etc RewriteCond %{REQUEST_URI} !^/home RewriteCond %{REQUEST_URI} !^/libs RewriteCond %{REQUEST_URI} !^/saml_login RewriteCond %{REQUEST_URI} !^/system RewriteCond %{REQUEST_URI} !^/tmp RewriteCond %{REQUEST_URI} !^/var RewriteCond %{REQUEST_URI} \.(jpe?g|png|svg|json|form)$ RewriteRule ^/(.*)$ /content/sample/$1 [PT,L] RewriteCond %{REQUEST_URI} !^/content/ [NC] RewriteCond %{REQUEST_URI} !^/etc.clientlibs [NC] RewriteCond %{REQUEST_URI} !^/bin [NC] RewriteCond %{REQUEST_URI} !^/libs RewriteCond %{REQUEST_URI} !\.(.+)$ #/ar-us RewriteRule ^/([^\?]*)(.*)$ /content/sample/$1.html$2 [PT,L] </IfModule>

 

Fanindra_Surat
Community Advisor
Community Advisor
May 30, 2023

Hi @ronnie09 ,

 

Can you check the publish log to see the actual request reaching the publish instance? Please also share the shortened URL, the actual full resource path and the configuration to shorten the resource to assist further.

 

Thanks,

Fani