Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 24th Jun 2013, 05:56 AM   #1
HyperActive Warrior
War Room Member
 
andrej's Avatar
 
Join Date: 2010
Location: Slovakia, EU
Posts: 179
Thanks: 90
Thanked 8 Times in 8 Posts
Default
Wordpress .httaccess redirect
Share on: 
fb share twitter share gplus share more share

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?

andrej is offline  
Unread 24th Jun 2013, 08:58 AM   #2
Active Warrior
War Room Member
 
Join Date: 2012
Posts: 71
Thanks: 2
Thanked 13 Times in 13 Posts
Default
Re: Wordpress .httaccess redirect
Share on: 
fb share twitter share gplus share more share

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.
Lani is offline  
The Following User Says Thank You to Lani For This Useful Post:
Unread 24th Jun 2013, 11:36 AM   #3
ɹoıɹɹɐʍ ǝʌıʇɔɐɹǝdʎɥ
War Room Member
 
RobinInTexas's Avatar
 
Join Date: 2008
Location: Texas
Posts: 2,138
Thanks: 243
Thanked 453 Times in 382 Posts
Blog Entries: 3
Default
Re: Wordpress .httaccess redirect
Share on: 
fb share twitter share gplus share more share

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.

Robin


...Even if you're on the right track, you'll get run over if you just set there.
RobinInTexas is offline  
The Following User Says Thank You to RobinInTexas For This Useful Post:
Unread 25th Jun 2013, 04:10 AM   #4
Active Warrior
 
Join Date: 2012
Posts: 50
Thanks: 0
Thanked 12 Times in 12 Posts
Default
Re: Wordpress .httaccess redirect
Share on: 
fb share twitter share gplus share more share

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
vrtechnologies is offline  
The Following User Says Thank You to vrtechnologies For This Useful Post:
Closed Thread


Bookmarks

Tags
httaccess, redirect, wordpress


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 12:53 PM.