Forum Moderators: phranque
New to mod_rewrite and have only been able to find tutorials online for complicated re-write rules like rewriting dynamic urls to static, etc.
I have a simple one.
I want to just change a few affiliate links so that instead of showing "domain.com/aff/123" to "domain.com".
Nothing dynamic about the urls.
Is there a way to do this?
Thanks for any info. I did a site search but again it seemed that most posts delt with more complicated used of mod_rewrite than what I'm looking for.
So, your question involves two parts; Change (in your case, manually) the URLs on your pages to something different from what is there now, and then use mod_rewrite to change those URLs back to the correct path needed to handel the next page requested by clicking that link. If these new links on your pages lead to another site, then mod_rewrite can't help, because your mod_rewrite code only runs on your server.
Jim
The reason I'm asking is because I recently came across a site that had a link written to a .zip file, "example.zip" which upon clicking would take you to an affiliate website.
I'm not looking to fake zip files, but rather just hide the affiliate link.
Could I do something like mod_rewrite a link to look like "www.mysite.com/productname" and then upon clicking it would take you to "www.affiliatesite.com"?
This has the effect of putting a redirect between the link on your site and the page on your affiliate's site. Search engines will follow that link, and may index the target URL as well, so I'm not sure what this really accomplishes except to diguise the target from people who check the status bar while hovering on your link. If that's all you need to do, then it should work OK.
Jim