Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: Alfjan on January 23, 2019, 01:53:26 AM

Title: How to redirect [url][/url]
Post by: Alfjan on January 23, 2019, 01:53:26 AM
Hello,

I'm not sure, if this ist the correct place for my request. Sorry if I miss.

I like to modify all  http://... oder https://...  (//http://://...) 

https:// -> https://anonym.to/?[b]https://...[/b]
http:// -> https://anonym.to/?[b]http://...[/b]


How can I do this?
Title: Re: How to redirect [url][/url]
Post by: br360 on January 23, 2019, 02:01:30 AM
Did you get an SSL certificate yet? If so, this step by step tutorial should help- https://www.simplemachines.org/community/index.php?topic=555034.0
Title: Re: How to redirect [url][/url]
Post by: Alfjan on January 23, 2019, 02:18:48 AM
I think I did not explain too clearly.

I want to automaticly change an outgoing http Adress to https://anonym.to/?[b]https://[/b] or https://anonym.to/?[b]http://[/b] the part between ist the origial link postet on the board. I tried it with word zensoring to chang it but I got too many changes, because it replaces the same part http: oder htps: more than once.

After that I change the url tag in bbc setion in subs.php but I get http://http://anonym.to/?http://google.de

Title: Re: How to redirect [url][/url]
Post by: Alfjan on January 23, 2019, 02:28:09 AM
This is the try via subs.php

array(
'tag' => 'url',
'type' => 'unparsed_equals',
'before' => '<a href="$1" class="bbc_link" target="_blank">',
'after' => '</a>',
'validate' => create_function('&$tag, &$data, $disabled', '
if (strpos($data, \'https://anonym.to/?http://\') !== 0 && strpos($data, \'https://anonym.to/?https://\') !== 0)
$data = \'https://anonym.to/?http://\' . $data;
'),
'disallow_children' => array('email', 'ftp', 'url', 'iurl'),
'disabled_after' => ' ($1)',
),

Title: Re: How to redirect [url][/url]
Post by: Alfjan on January 23, 2019, 03:18:25 AM
@bryangreene

I'm not sure, but your answer does not fix my problem.

First link is as it was postet on my forum.
google.com (http://google.com)

I like to automaticly change that to this.

https://anonym.to/?google.com (https://anonym.to/?google.com)

By the leadig h t t p s://anonym.to?

QuoteThe advantages of anonymizing your external links with anonym.to Webmasters can use this tool to prevent their site from appearing in the server logs of referred pages as referrer.
The operators of the referred pages cannot see where their visitors come from any more.Using the referrer removal service is quite easy:
https://anonym.to/?http://www.gulli.com/ produces an anonymous link to gulli.com which prevents the original site from appearing as a referrer in the logfiles of the referred page.
Title: Re: How to redirect [url][/url]
Post by: Aleksi "Lex" Kilpinen on January 28, 2019, 04:57:19 AM
Perhaps if you take a look at how this mod is done, you might get a few good pointers - It may even work as is ( though it is old, and originally made for 2.0 RC1 ) but can't promise it will.
https://custom.simplemachines.org/mods/index.php?mod=894