.htaccess 301 Redirect (old url for new update) with php get request
I am trying to redirect several old urls to new ones using htaccess, which rewrites the GET request in my PHP file to clean up the urls:
Options +FollowSymLinks
RewriteEngine on
RedirectMatch 301 /photo/old-photo /photo/new-photo
RewriteRule ^photo/(.*)/?$ tpl-photo.php?slug=$1
RewriteRule ^photo/(.*)?$ tpl-photo.php?slug=$1
This outputs my clean urls like so:
http://website.com/photo/one-beautiful-photo
However, when I try to redirect old urls to new urls it messes up the url somehow:
http://website.com/photo/new-photo?slug=old-photo
How can I fix this to get the correct clean url:
http://website.com/photo/new-photo
+3
source to share