Expand my Community achievements bar.

AEM Dispatcher post servlet is converting to GET

Avatar

Level 7

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

5 Replies

Avatar

Community Advisor

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.

Avatar

Level 7

@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>

Avatar

Community Advisor

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.

Avatar

Level 7

@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>

 

Avatar

Community Advisor

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