Forum Moderators: phranque
I want to change my affiliate links from the following format
affiliatesite.com/index.jsp?pageName=Search&cid=1234&search=widgets
To
mysite.com/search/widgets
I then want to exclude the search directory in the robots.txt file so I am not hit with a duplicate content penalty.
I would really appreciate if somebody could advise me how to do this. Including what files I need to edit and where they need to be placed.
Thank you in advance.
Gosman
If it's just redirection you're looking for, this should do it;
RewriteRule ^search/widgets affiliatesite.com/index.jsp?pageName=Search&cid=1234&search=widgets [L]
If they were you could tell mod_rewrite to read the content from another directory, but with the content being on another machine, the browser actually has to connect to the other domain, which means redirect, not internal rewriting...
If your heart is st on doing this though, you'll need to get a script which can connect to the other server and output it on your site.
Neither are very hard to do.
Thank you for the replies. I need to clarify a little bit more. What I am trying to acheive is the following.
mysite.com/product/54321
redirected to
[myaff.com...]
54321 being a product id variable.
I have done some research on mod rewiting and I beleive I have created some code that may work
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^product/(.*)$ [myaff.com...]
What I now need to know is does the code look valid? and if so, where I place this code on my server? The server our site is on is a cobalt raq.
Thank you.
Gosman
[domain...] to localhost:10000
to avoid setting up webmin with SSL. Passwords use SSL across the Internet and pass clearly on the local machine.
The ethics of doing this (passing off someone else's content as your own), however, I leave up to you.
The reason I wanted to do this is not to pass somebody elses content off as my own.
Let me explain.
I am an affiliate for Acme. Acme let me upload a header so the pages I display from them are styled like my site. I have a subdomain acme.mysite.com which actually points to their server. When I do an allinanchor:mysite.com all of the pages acme.mysite.com have been indexed. I think the reason for this is because there is enough of a difference on the page with my header included. To make sure I do not trip any dup content filters I want to exclude all of acme.mysite.com. To acheive this I done a mod rewrite of acme.mysite.com to mysite.com/acme and then excluded /acme in the robots.txt file.
Regards
Gosman