Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Wordpress .httaccess redirect (https://www.warriorforum.com/programming/804865-wordpress-httaccess-redirect.html)

andrej 24th June 2013 05:56 AM

Wordpress .httaccess redirect
 
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?

Lani 24th June 2013 08:58 AM

Re: Wordpress .httaccess redirect
 
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.

RobinInTexas 24th June 2013 11:36 AM

Re: Wordpress .httaccess redirect
 
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.

vrtechnologies 25th June 2013 04:10 AM

Re: Wordpress .httaccess redirect
 
Hello,

You will use the plugin that will be good
WordPress › Simple 301 Redirects « WordPress Plugins
WordPress › Redirection « WordPress Plugins

This will 100% resolve the issue


All times are GMT -6. The time now is 01:02 PM.