I am currently working on my website where I've found some weird urls. I am trying to redirect (301) url's to the correct url but I cannot figured out how to correctly redirect those url's in .htaccess.
e.g. old url
/slug/variable-%language%.html
Al those urls should redirect to
/slug/variable-english.html
Where 'variable' can have different values (also with an '-' separator included.
Many thanks!
Something like this:
Redirect 301 /slug/variable-english.html http://www.domain.com/slug/variable-english.html
Redirect 301 /slug/variable-chinese.html http://www.domain.com/slug/variable-chinese.html
Why can you not just redirect to new domain as the rest of the urls is the same?
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example-old\.com$ [NC]
RewriteRule ^(.*)$ http://www.example-new.com/$1 [R=301,L]