Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 23rd Sep 2010, 06:27 PM   #1
Senior Warrior Member
 
Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
Default
Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Thanks.

I have 4 affiliate links which I need redirecting from 4 Seperate URLS.

So here are the 4 Redirect pages (I am having difficulty producing)
www.MyDomain.com/Suprise1
www.MyDomain.com/Suprise2
www.MyDomain.com/Suprise3
www.MyDomain.com/Suprise4

The above 4 will be redirected to the above ones
www.AffiliateProduct1.com
www.AffiliateProduct2.com
www.AffiliateProduct3.com
www.AffiliateProduct4.com

the basic concept is this:

www.MyDomain.com/Suprise1 -> www.AffiliateProduct1.com (redirected after 0 seconds)

www.MyDomain.com/Suprise2 -> www.AffiliateProduct2.com (redirected after 0 seconds)


So i need to set this up 4 times. using the QUICK method which you have said is the Htaccess file version?

(in my other question here - http://www.warriorforum.com/programm...ml#post2618899 )
entry is offline  
Unread 24th Sep 2010, 07:22 AM   #2
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Code:
Redirect 302 /Surprise1 http://www.AffiliateProduct1.com
Redirect 302 /Surprise2 http://www.AffiliateProduct2.com
Redirect 302 /Surprise3 http://www.AffiliateProduct3.com
Redirect 302 /Surprise4 http://www.AffiliateProduct4.com
Substitute your own URLs in the above. Place the .htaccess file in the webroot directory of mydomain.com.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 24th Sep 2010, 06:37 PM   #3
Senior Warrior Member
 
Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Thanks.

Can you give some more detail on it please, i am still a bit confused. Can you give it in a bit more detail please.
entry is offline  
Unread 25th Sep 2010, 06:30 AM   #4
Active Warrior
 
Join Date: 2010
Posts: 61
Thanks: 2
Thanked 3 Times in 3 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

It's pretty simple..... in "SteveJohnson's" example it will redirect the file "/Surprise1" (ie; mydomain.com/Surprise1") to "AffiliateProduct1.com" & so on..

The 302 just means it's a temporary redirect & not a permanent one.
cyphix is offline  
Unread 25th Sep 2010, 05:35 PM   #5
Senior Warrior Member
 
Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Originally Posted by cyphix View Post

It's pretty simple..... in "SteveJohnson's" example it will redirect the file "/Surprise1" (ie; mydomain.com/Surprise1") to "AffiliateProduct1.com" & so on..

The 302 just means it's a temporary redirect & not a permanent one.
a) Temporary Not Permanant?...why is it good to be temporary and not permanent?

b) or what is the disadvantage of it being temporary?


c) Is Steves method (the above 302 .htaccess one reliable for 3-4 years (it is for an AR series)..... which is why i am asking for permanant VS Temporary.

d) and am i inserting that code in the .htaccess

e) Is it .htaccess. or .htaccess.txt or .htaccess.htm ?
entry is offline  
Unread 25th Sep 2010, 06:40 PM   #6
Website translator
 
Join Date: 2010
Posts: 19
Thanks: 0
Thanked 1 Time in 1 Post
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Temporary vs permanent is up to you. Use permanent if you think that the links will never change. I prefer temporary because I might drop the affiliate at a certain moment, and also because a 301 (permanent) redirect passes link juice to the target (unless you use a nofollow link to your /Surprise pages (which is highly recommended).

For a permanent redirect, use 301 instead of 302 in Steve's script.

The .htaccess is a simple text file, but you need to leave the name just like that. I.e., .htaccess, NOT .htaccess.txt or .htaccess.htm
SEOTranslator is offline  
Unread 26th Sep 2010, 12:51 PM   #7
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

I use 302 redirects on aff links because I want the visitor's browser checking every time. If you use a 301 (which is totally fine, if you're sure the target destination will never change), the browser knows it has been redirected permanantly and caches the result, never to check again until its cache expires.

Or at least that's the theory.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 26th Sep 2010, 03:15 PM   #8
Senior Warrior Member
 
Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Redirect 302 /Surprise1 http://www.AffiliateProduct1.com
Redirect 302 /Surprise2 http://www.AffiliateProduct2.com
Redirect 302 /Surprise3 http://www.AffiliateProduct3.com
Redirect 302 /Surprise4 http://www.AffiliateProduct4.com

For the above, do these following pages

/Surprise1
/Surprise2
/Surprise3
/Surprise4

^^ Do these, Have to actually exist, on the server? (as actual uploaded pages)

-and if so, what should these pages contian? (can it just be a blank empty HTML file?
entry is offline  
Unread 26th Sep 2010, 03:49 PM   #9
Active Warrior
 
Join Date: 2010
Posts: 61
Thanks: 2
Thanked 3 Times in 3 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

I'm pretty sure they don't have to exist... as the server will just redirect anyone going to that URL to the new URL; don't think it bothers to check if it exists.

Though if you have 404 redirection code in there too, not sure how friendly it plays with that.... probably best to just create blank files.
cyphix is offline  
Unread 26th Sep 2010, 04:54 PM   #10
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

No need to create files, they do NOT have to exist. Your server looks at the .htaccess file for the folder before it looks for and attempts to load a file.

The only time a 404 is sent by the server is when it attempts to load a file that isn't there. In your case, it's not even getting to that stage.

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Unread 26th Sep 2010, 05:51 PM   #11
Senior Warrior Member
 
Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Originally Posted by SteveJohnson View Post

No need to create files, they do NOT have to exist. Your server looks at the .htaccess file for the folder before it looks for and attempts to load a file.

The only time a 404 is sent by the server is when it attempts to load a file that isn't there. In your case, it's not even getting to that stage.
So it redirects without creating the files?

could that ever cause an error? or it should be fine?

(couldi be extra safe and include the files,
as Surprise1/index.htm )

so if it is ever needed by the email subscribers, they can find it?
entry is offline  
Unread 26th Sep 2010, 08:12 PM   #12
VIP Warrior
War Room Member
 
SteveJohnson's Avatar
 
Join Date: 2007
Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
Default
Re: Creating 4 Redirect URLs, (using Htaccess) ?
Share on: 
fb share twitter share gplus share more share

Originally Posted by entry View Post

So it redirects without creating the files?

could that ever cause an error? or it should be fine?

(couldi be extra safe and include the files, as Surprise1/index.htm ) so if it is ever needed by the email subscribers, they can find it?
Yes, it redirects without creating files. No, it will never cause an error. As I said, the server loads and executes the .htaccess file before it even goes looking for the requested file.

You can, of course, do whatever you want in creating files. It's just a waste of your time. If you do the redirect properly, the file will never ever get served to a browser. Never.

When you look at a WordPress blog, not a single page that you view exists on the server. It's all done with redirects (actually rewrites, but the same concept).

The 2nd Amendment, 1789 - The Original Homeland Security.

Gun control means never having to say, "I missed you."
SteveJohnson is offline  
Closed Thread


Bookmarks

Tags
creating, htaccess, redirect, urls


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 10:35 PM.