.htaccess - Redirect not working for Wordpress Site

I have this RewriteRule Here:

RewriteRule ^TWI$ https://www.paypal.com

But its not working, basically what I am trying to do is have a page like so https://example.com/TWI redirect to paypal's website. What am I doing wrong? Here are are rest of my rules:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^TWI$ https://www.paypal.com
</IfModule>

1 answer

  • answered 2019-08-13 07:03 JarekBaran

    I have changed the order of the rules, please check:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /
        RewriteRule ^TWI$ https://www.paypal.com [R=301,L]
        RewriteRule ^index\.php$ - [L]
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule . /index.php [L]
    </IfModule>