Reputation: 21
I neee to redirect
http://www.example.com.au/recipes/recipe.aspx?name=91-Sunflower%20Crackers
to https://www.example.com.au/recipes/
I followed so many posts but this is not redirecting at all.
This is my code
RewriteCond %{QUERY_STRING} ^name=91-Sunflower%20Crackers$
RewriteRule ^/recipes/recipe\.aspx?$ /recipes/? [NE,L,R]
What is the error here ?
Upvotes: 1
Views: 70
Reputation: 786329
This rule should work:
RewriteCond %{QUERY_STRING} "^name=91-Sunflower(\s|%20)Crackers$" [NC]
RewriteRule ^recipes/recipe\.aspx?$ /recipes/? [NC,L,R]
No leading slash in RewriteRule
and use (\s|%20)
in RewriteCond
to match a whitespace.
Upvotes: 1