I need a redirect that will redirect a long style url to short style url.
EX:
http://www.domain.com/mm5/merchant.mvc?Screen=CTGY&Store_Code=H&Category_Cod e=AMI_H2
>
http://www.domain.com/c/AMI_H2.html
This redirect works if you change the CTGY or PROD code, but other wise it will go into a redirect loop:
This fixes the redirect loop but makes pagination redirect you to the shor category page:
So I was thinking something like this might work, but I cant get it to function properly:
Is there any validity to that Idea? I am thinking if your store is the referrer then it will stop the redirect from occurring. Because in this case the only time someone would get to these links would be a bookmark, or through pagination.
Any help with this would be greatly appreciated!
EX:
http://www.domain.com/mm5/merchant.mvc?Screen=CTGY&Store_Code=H&Category_Cod e=AMI_H2
>
http://www.domain.com/c/AMI_H2.html
This redirect works if you change the CTGY or PROD code, but other wise it will go into a redirect loop:
Code:
RewriteCond %{QUERY_STRING} Category_Code=AMI_H2& [NC,OR] RewriteCond %{QUERY_STRING} Category_Code=AMI_H2$ [NC] RewriteRule ^(.*)$ http://www.domain.com/c/AMI_H2.html? [L,R=301]
Code:
RewriteCond %{REQUEST_URI} !^/c/AMI_H2.html RewriteCond %{QUERY_STRING} ^Category_Code=AMI_H2(.*)$ [NC] RewriteRule ^(.*)$ http://www.hummerpartsclub.com/c/AMI_H2.html? [L,R=301]
Code:
RewriteCond %{REQUEST_URI} !^/c/AMI_H2.html$ RewriteCond %{HTTP_REFERER} !^domain\.com$ RewriteCond %{QUERY_STRING} Category_Code=AMI_H2 [NC] RewriteRule ^(.*)$ http://www.domain.com/c/AMI_H2.html? [L,R=301]
Any help with this would be greatly appreciated!
Comment