I am trying to both rewrite and redirect this URL:
https://www.domain.com/video-lessons-page.php?item=stocks
to go to this URL:
https://www.domain.com/stocks-video-lessons
Here is the code I'm currently working with:
RewriteCond %{QUERY_STRING} ^item=([^&]+)
RewriteRule ^/?video-lessons-page\.php$ https://www.domain.com/%1-video-lessons? [R=301,L]
RewriteRule ^(stocks|finance|accounting)-video-lessons$ video-lessons-page.php?item=$1 [NC,L]
Unfortunately with the above code I'm having issues. The first two lines work great by themselves in that it redirects /video-lessons-page.php?item=stocks to /stocks-video-lessons.
And the third line also works great by itself to where the /stocks-video-lessons URL functions correctly with the GET variable and the page's code.
But putting them together is problematic. Right now I'm getting errors like "www.domain.com redirected you too many times." etc. Any ideas?