Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1085307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:40:22+00:00 2026-05-16T22:40:22+00:00

I need to handle HTTP URLs that begin with a certain domain with my

  • 0

I need to handle HTTP URLs that begin with a certain domain with my app, because it points to a REST source. The web service however is not under my control, so i can’t easily introduce a custom url scheme to open the links with my app.

Is there a way to intercept and handle such URLs in a Cocoa app?

Example: http://static.domain.name/some/random/path

My app should handle all links pointing to http://static.domain.name

I’m afraid that the answer will be NO, but hey, everything is possible somehow :).

Update


This is the Safari extension code i used to make it work (content in <> replaced with your stuff)

var allLinks = document.links;
for (var i=0; i<allLinks.length; i++) {
    var link = allLinks[i];
    if (/.*<match>.*/.test(link.href)) {
        var rewrite = link.href.replace(/<match>/, "<customscheme>://");
        link.href = rewrite;
        console.log("Rewrote: " + rewrite);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:40:23+00:00Added an answer on May 16, 2026 at 10:40 pm

    Just encode the whole url under your own scheme, e.g. myscheme://http%3A//static.domain.name/some/random/path

    When your application handles the URL, just chop off the first part and unescape it:

    - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
        NSString * urlString = [url description];
        // Remove your scheme
        urlString = [urlString stringByReplacingOccurrencesOfString:@"myscheme://" withString: @""];
        // Unescape
        urlString = [urlString stringByReplacingPercentEscapesUsingEncoding: NSASCIIStringEncoding];
        // Do something with urlString
        return YES;
    }
    

    But no. You can’t be assigned to handle http://

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build a web service to handle HTTP Form posts (CRUD) using
I need to handle some HTTP URLs in a Perl program, but I have
Due to factors outside my control, I need to handle urls like this: http://www.bob.com/dosomething.asp?val=42
For a project I need to handle audio in an iPhone app quite special
I am developing 2D game for iPhone, for that I need to handle collision
I need to redirect some urls. Formerly I had http://mysite.com/foobar/?section_id=1234 These are no pointing
I'm trying to redirect to a swf file because I need to embedd that
Possible Duplicate: How to use java.net.URLConnection to fire and handle HTTP requests? I need
I need to handle events of two different types but I'm running into the
I need to handle strings in my php script using regular expressions. But there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.