admin管理员组

文章数量:1313952

I have a page that only users of my native iOS app will find, which should open the app. This works (on any other HTML page anyway) by linking to "myapp://path/inside/app".

Wordpress keeps "fixing" this to "https://path/inside/app", which doesn't work of course. I didn't find a setting to stop it from doing this. Is this possible?

I have a page that only users of my native iOS app will find, which should open the app. This works (on any other HTML page anyway) by linking to "myapp://path/inside/app".

Wordpress keeps "fixing" this to "https://path/inside/app", which doesn't work of course. I didn't find a setting to stop it from doing this. Is this possible?

Share Improve this question asked Nov 25, 2020 at 16:39 StefanStefan 1011 bronze badge 3
  • 1 Where are you adding this link from? From the editor, the menu configuration page? My suggestion for this would be to use JavaScript to dynamically change the href of the link when somebody clicks it. – Deepak Kamat Commented Nov 25, 2020 at 16:47
  • Adding the link from the editor. – Stefan Commented Nov 25, 2020 at 20:48
  • Basically, I need something like this: sevenspark/tutorials/skype-uri-link-wordpress-menu but not for the skype:// protocol. Isn't editing the themes functions.php the wrong approach here as it gets overwritten on update? – Stefan Commented Nov 27, 2020 at 7:38
Add a comment  | 

2 Answers 2

Reset to default 0

I think your problem is that an HTML page is a single point of reference. Swift allows you to define that custom URL in your app ( https://www.hackingwithswift/example-code/system/how-to-make-your-app-open-with-a-custom-url-scheme) but WordPress rewrites itself and all sub-pages, api etc. to the URL defined in the database options. So, short answer, you can't do that. If you were to set the URL of the WordPress site to myapp://whatever it would break. Do you have to use myapp:// ?

I created this plugin to address my problem: https://github/mehlkelm/Allow-My-URL-Schemes At the moment it only works for my apps, pull requests welcome!

本文标签: Wordpress rewrites my link with custom URL scheme to http(s)