0

For example my link is mydomain.com/weather-is-good and i need it to go to audiofile.com/s-1234?si=5678

RewriteCond %{HTTP_HOST} ^mydomain\.com€ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com€
RewriteRule ^weather\-is\-good€ "https\:\/\/audiofile\.com\/s\-1234\?si\=5678" [R=301,L]

gives me

/s-1234%26si=5678

1
  • 1
    I think the formatting of this post got corrupted when you copied it. Should the "Euro Sumbol" be a $ ?
    – davidgo
    Commented Sep 4 at 10:24

1 Answer 1

4

I think it should look like this:

RewriteCond %{HTTP_HOST} ^mydomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteRule ^weather\-is\-good$ https://audiofile.com/s-1234?si=5678 [R=301,L]

We remove the quotes, add a dollar sign at the end of the URL for exact matching, and use the flag, in our case, a 301 redirect.

Check it out, seems like it should help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.