I tried a lot, looked in the other posts but didn’t get it to work..
-
I want to redirect olddomain.com/?portfolio=this-is-the-title-of-the-post to newdomain.com/portfolio/newtitle1/
-
I want to redirect olddomain.com//?portfolio=10689 to newdomain.com/portfolio/newtitle2/
-
I want to check if mu redirect olddomain.com to newdomain.com is set correct
UPDATE: After your first answers I updated it to this but still not working:
RewriteCond %{QUERY_STRING} ^portfolio=this-is-the-title-of-the-post$
RewriteRule ^ http://newsite.com/portfolio/newtitle1/? [R=301,L]
RewriteCond %{QUERY_STRING} ^portfolio=10689$
RewriteRule ^ http://newsite.com/portfolio/newtitle2/? [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN 301 Redirects
Redirect 301 /index.php http://newsite.com
Redirect 301 /cart/ http://shop.newsite.com/cart/
Redirect 301 /my-account/ http://shop.newsite.com/my-account/
Redirect 301 /shop/ http://shop.newsite.com/
Redirect 301 /portfolio-one-column-standard-style/ http://newsite.com/portfolio/
Redirect 301 /home/blog/ http://newsite.com/blog/
Redirect 301 /about/ http://newsite.com/about/
# END 301 Redirects
Try these 2 rules at top of your .htaccess:
You forgot to add
RewriteEngine On
before below rules: