Hi,
The rewrite rules are not working for having source url's extension as html, they are not redirecting to the destination url on browser and source url remains same, for example below redirects don't work while other redirects having no extension or other extension are working fine. Any leads?
1. RewriteRule ^/applications/life-science-research.html /en/products-solutions/all-application.html [R=301,L,NC]
2. RewriteRule ^/applications/life-science-research/dna-sequencing.html /en/products-solutions/all-application.html [R=301,L,NC]
3. RewriteRule ^/products/assays.html /en/products-solutions/by-category/assays.html [R=301,L,NC]
Regards,
Shivam
Solved! Go to Solution.
Views
Replies
Total Likes
The rules should work, you need to pay attention to the order of the RewriteRules.
For example, if you have another rewrite rule that adds the "long" URL (will transform /applications/life-scrience-research.html -> /content/yoursite/en/applications...), this rule will not match because of that ^ meaning that's the start of the string.
PS: You should add "LogLevel debug rewrite:trace6" and you will see the "order" and matching of your rules in the logs.
The rules should work, you need to pay attention to the order of the RewriteRules.
For example, if you have another rewrite rule that adds the "long" URL (will transform /applications/life-scrience-research.html -> /content/yoursite/en/applications...), this rule will not match because of that ^ meaning that's the start of the string.
PS: You should add "LogLevel debug rewrite:trace6" and you will see the "order" and matching of your rules in the logs.
Views
Replies
Total Likes
@shivama92274331 You can check what is the request URL that is being sent in the dispatcher.log as well as in the publish instance request.log. There might be some rules that are added which are causing the issue and it's not allowing to redirect with .html extension.
Looking into the dispatcher log and request.log will give more idea on the issue.
Can you share with us your entire file please, you might have some other rewrites before these 3 rules. That might be the causing problem.
From what I am seeing, your redirect rule looks fine.
Also make sure you add $ to indicate that this is the end of the pattern.
RewriteRule ^/applications/life-science-research.html$ /en/products-solutions/all-application.html [R=301,L,NC]
Views
Replies
Total Likes
Views
Likes
Replies