Wordpress .httaccess redirect

by 3 replies
4
I want to redirect 2 affiliate links on my Wordpress website using the .httaccess file. By default the .httaccess file looks the following:

PHP Code:
# 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 
I wonder if everything will work fine if I add 2 lines (the redirect codes) at the bottom? It would look the following way:

PHP Code:
# 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 
Will my Wordpress website work without any problems? Can I do this?
#programming #httaccess #redirect #wordpress
  • Hey

    I had this same problem long time ago, I did not know if it will work or not.
    So, I installed this plugin:
    WordPress › Quick Page/Post Redirect Plugin « WordPress Plugins

    Install it, go to "Quick Redirects" page and set your redirects as you want.
    It will automaticaly update .htaccess file so you dont have to worry about it.
    • [ 1 ] Thanks
    • [1] reply
    • The two lines at the bottom should work

      Code:
      #begin redirects
      Redirect 302 /getbucks http://google.com/paymemoney
      #end redirects
      I would suggest a 302 in case you change the destination.
      • [ 1 ] Thanks
      • [1] reply

Next Topics on Trending Feed