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 8289109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:25:59+00:00 2026-06-08T12:25:59+00:00

College B has a subscription to Website A which they access through their internal

  • 0

College B has a subscription to Website A which they access through their internal proxy, which alters all the pages URLs to accommodate redirects through their proxy.

For instance, the about us page on Website A typically looks like this:

website-a.com/about/us

if you view the page over college B’s proxy connection, that link would be:

website-a.proxy-b.com/about/us

The rewrite is done on the proxy, Website A has no control over it.

This isn’t at all uncommon, so I’m hoping the problem I’m looking at is an easy fix:

Website A uses a Google Custom Search Engine… The search runs after the proxy has done its URL rewriting, and the dynamic search results will return with UNALTERED URLs… so if a proxy user follows one, they are returned to our site directly, and lose any access they would have had under the proxy.

(Please assume, for simplicities sake, that I’m looking for a solution to be implemented by Website A, and that Proxy B is not managed by anyone who can change anything to make this lookup happen on the College’s side)

I’m looking at rewriting the URLS after the results are returned from google using javascript… but looking at the code, I foresee some serious issues with that.

Has anyone managed to get around this, or is there a simple CSE trick to rewrite the target URLs on the fly?

  • 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-06-08T12:26:00+00:00Added an answer on June 8, 2026 at 12:26 pm

    Found a solution:

        function fixProxyLinks(){
            proxy_rex = new RegExp( document.location.host, "gi");
            orig_rex = new RegExp( "/www.mysite.com/", "gi");
    
            //Check if current server is DIFFERENT from bg.com
            if( document.location.host.search( orig_rex ) == -1 ){
                $('.gsc-results a').each( function(){
                    // Find all the fresh new search results and correct them for the sake of the Proxy
    
                    if( this.href.search( proxy_rex ) == -1 &&  this.href.search( bg_rex ) >= 0 ){
                        this.href = this.href.replace( orig_rex, '/'+document.location.host+'/' );
                        $(this).attr("data-cturl", this.href);
                        $(this).attr("data-ctorig", this.href);
    
                    }
                });
            }
        }
    

    And then you stick this in where you’re building your CSE object:
    customSearchControl.setSearchCompleteCallback(this, fixProxyLinks);

    NOTE: About the data-cturl and data-ctorig attributes:
    Part of the CSE functionality is to REWRITE that url to redirect through google for tracking, data-cturl is the URL that it will rewrite the href to on click. Unfortunately, you have to replace the google redirect completely and just have the redirect target the same Proxy url, or Google will notice and put up a warning that you are being redirected.
    Once the user has clicked, CSE will write the href back to the value set in data-ctorig so you obviously want to have that match as well.

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

Sidebar

Related Questions

I have a website (my college website) for which each student has a username/password
I have a table called Classes which stores information on College classes. It has
Background I graduated 6 months ago, and my collaborative work in college has all
My college has 5-6 proxy servers and occasionally some of them are down or
I'm about to deploy a college website. It has around 2200 user profiles generated
So a user has many colleges (that they have attended), and a college belongs
I'm making a bookshop website (for a little college javascript project) So far all
Heyo, My class at college has us writing programs in assembly. I have never
I have a search page that has 6 textboxes which i pass as FormCollection
Scenario: I have a Question which has 2 radio buttons & two subforms: subformA

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.