Wordpress .httaccess redirect

Discussion in 'Programming' started by andrej, Jun 24, 2013.

  1. #1
    I want to redirect 2 affiliate links on my Wordpress website using the .httaccess file. By default the .httaccess file looks the following:
    # 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
    PHP:
    I wonder if everything will work fine if I add 2 lines (the redirect codes) at the bottom? It would look the following way:
    
    # 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
    
    
    redirect 301 /hostgator http://secure.hostgator.com/~affiliat/cgi-bin/affiliates/clickthru.cgi?id=andrej1
    redirect 301 /bluehost http://www.bluehost.com/track/andrej1
    PHP:
    Will my Wordpress website work without any problems? Can I do this?
     
    Solved! View solution.
    andrej, Jun 24, 2013 IP
  2. #2
    Sure, it's fine. 301 redirects should not affect your WP install unless you accidentally set up redirects that relate directly to your published content.
     
    I. Brian, Jun 24, 2013 IP
    andrej likes this.
  3. andrej

    andrej Notable Member

    Messages:
    3,210
    Likes Received:
    130
    Best Answers:
    0
    Trophy Points:
    220
    #3
    OK, thank you for your advice.
     
    andrej, Jun 25, 2013 IP