Click here to Skip to main content
15,879,535 members
Please Sign up or sign in to vote.
1.33/5 (4 votes)
See more: , +
I need to create something like this > Cloak Affiliate Links in WordPress – ThirstyAffiliates[^] in asp.net core. Any ideas on how to do this?

The main features I need is:
1. Cloak links > Example abc.com/go/google.com should take me to https://www.google.com
2. Auto Insert links in the content > Example, if I want to associate the link with the text "visit Google", it should auto hyperlink on all the pages of my website. Check the best example: Keywords to Links Converter – WordPress plugin | WordPress.org[^]

What I have tried:

Need a lead to start. I can create a table in the database with anchor text and the URL and the cloak slug.
Posted
Updated 2-Sep-19 2:04am
v2
Comments
DerekT-P 2-Jun-19 16:58pm    
part 1: Just use URL rewriting? (assuming that abc.com is your domain... but we're guessing here!)
part 2: what is "it"? (It should auto...) do you want to do this client-side? Or in the d/b? or in C# code? Are the links dynamically generated from the d/b somewhere, or are they in the aspx page content, or... what? You've really given us no information on what you're trying to do.
Mr_cool 3-Jun-19 4:55am    
See, as mentioned I'll create a db with 3 fields say (Cloak name, anchor, link).

the table values will be (google, visit google, https://www.google.com

Part one
Example:
If you want to search anything, visit google.


Now, if someone clicks on the hyperlink that says visit google, then the browser should redirect to google.com

This part can be done using redirect. Ok not an issue.

Part Two:
Now, say domain.com has 200 pages on the website and the pages are dynamic (populating data from DB). Now, I want to create a system that for every page where visit Google is written, auto hyperlink it with the url https://www.domain.com/go/google when the browser loads the page.

and there will be many other terms which I want to auto hyperlink


So there will be a lot of terms, I need a way to do it which wont consume too much time and the page loads almost instantly.

1 solution

If by cloaking links you mean URL rewriting, check out this link: URL Rewriting in ASP.NET | Microsoft Docs[^] They have given a very good step by step instruction.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900