| | #1 |
| Senior Warrior Member Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
| 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 ) |
| |
| | #2 |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
| 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 |
|
The 2nd Amendment, 1789 - The Original Homeland Security. Gun control means never having to say, "I missed you." | |
| |
| | #3 |
| Senior Warrior Member Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
| 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. |
| |
| | #4 |
| Active Warrior Join Date: 2010
Posts: 61
Thanks: 2
Thanked 3 Times in 3 Posts
|
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. |
| |
| | #5 | |
| Senior Warrior Member Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
|
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 ? | |
| |
| | #6 |
| Website translator Join Date: 2010
Posts: 19
Thanks: 0
Thanked 1 Time in 1 Post
|
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 |
| |
| | #7 |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
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." | |
| |
| | #8 |
| Senior Warrior Member Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
| 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? |
| |
| | #9 |
| Active Warrior Join Date: 2010
Posts: 61
Thanks: 2
Thanked 3 Times in 3 Posts
|
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. |
| |
| | #10 |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
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." | |
| |
| | #11 | |
| Senior Warrior Member Join Date: 2009
Posts: 1,877
Thanks: 248
Thanked 26 Times in 26 Posts
|
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? | |
| |
| | #12 | |
| VIP Warrior War Room Member Join Date: 2007 Location: Caldwell, Idaho, USA.
Posts: 1,967
Thanks: 1,024
Thanked 2,043 Times in 1,183 Posts
|
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." | ||
| |
|
| Bookmarks |
| Tags |
| creating, htaccess, redirect, urls |
| |