i am trying to rewrite a URL for SEO purpose.
The old URL is:
http://www.example.com/recipe_local.php?hl_cusine=1
The new URL should be like bellow and automatic redirect to this url if user come above url
http://www.example.com/recipes/healthy-recipes
My Code in the .htaccess is:
RewriteEngine on
RewriteRule ^recipes/healthy-recipes/$ recipe_local.php?hl_cusine=$1 [NC,L]
RewriteRule ^recipes/healthy-recipes$ recipe_local.php?hl_cusine=$1 [NC,L]
Even after hours of research, i have no clue why this is not working :(
healthy-recipesbecomehl_cusine=1in rewrite rules only?http://www.example.com/recipes/healthy-recipes/42, it acts as though they typedhttp://www.example.com/recipe_local.php?hl_cusine=42(internal rewrite). Second, with a completely different rule, you want to make it so that when a user actually typeshttp://www.example.com/recipe_local.php?hl_cusine=42, their browser is told to instead loadhttp://www.example.com/recipes/healthy-recipes/42(external redirect).