I'm trying to do a 301 redirect using Apache httpd. Below is my vhost.conf
<VirtualHost *:80>
ServerName www.example.com
ServerAlias *.example.com
ProxyPass / http://www.example.com:8080/
ProxyPassReverse / http://www.example.com:8080/
ProxyPreserveHost On
RewriteEngine On
RewriteCond %{QUERY_STRING} ^detailStory=([^&]+)$
RewriteRule ^(.*)$ /story/%1? [L,R=301,NE]
</VirtualHost>
It seems to be working fine when I add the IP to the domain name configuration(route 53). But when I introduce an AWS ELB and configure domain name with its value, the redirection stops working(Note: I'm able to access the website but the redirection doesn't seem to be working).
Any idea on how to resolve this or is there a way to setup dynamic redirection directly in AWS load balancer?
Any advice/comment would be highly appreciated! Thank you in advance!