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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:22:10+00:00 2026-06-10T03:22:10+00:00

I have two hostnames that get sent to the same IP by my DNS:

  • 0

I have two hostnames that get sent to the same IP by my DNS:

  • theark.info
  • http://www.theark.info

I explicitly set my callback and domain name in my Twitter App using theark.info. What is the best way to make sure I can use the same Twitter App for Oauth using www.theark.info, as I currently get an error:

Internal Server Error

In my DNS I have a CNAME www in my DNS that points to theark.info

Maybe I need to manipulate the DOM using Express and Javacsript on requests?

  • 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-10T03:22:12+00:00Added an answer on June 10, 2026 at 3:22 am

    You can’t change Twitter (or any other OAuth provider), they all offer only one callback to one domain. An easy solution is to re-route all requests from http://domain.com to http://www.domain.com, so all visitors end up at http://www.domain.com before authenticating. You should be able to do this on your DNS or with a req.header redirect server-side:

    app.get('/*', function(req, res, next) {
      if (req.headers.host.match(/^www/) !== null ) {
        res.redirect('http://' + req.headers.host.replace(/^www\./, '') + req.url);
      } else {
        next();     
      }
    })
    

    Copied from this answer.

    When authenticating with passport.js, try to specify the callback url:

    passport.use(new TwitterStrategy({
        consumerKey: auth_keys.twitter.consumerKey,
        consumerSecret: auth_keys.twitter.consumerSecret,
        callbackURL: auth_keys.twitter.callbackURL
      },
      function(token, tokenSecret, profile, done) {
        process.nextTick(function () {
          User.twitterAuth({ profile: profile }, function (err, user) {
            return done(err, user);
          });
        });
      }
    ));
    

    And make sure the callbackURL is exactly the same as configured in Twitter. If you’re running node for development on localhost, try two different key files and create another authentication apps on twitter with 127.0.0.1:3000 as callback address. You can switch key files for dev and production:

    if (app.get('env') == 'development') {
      auth_keys = require('./lib/keys_dev');
    } 
    if (app.get('env') == 'production') {
      auth_keys = require('./lib/keys_live');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

imagine that I have two services with the same domain but different hostnames and
I have two columns say Main and Sub . (they can be of same
I have two queries that find both the Zip codes, and the States for
I have two web applications in ASP.NET which are quite the same (same business
We have a situation where two web applications are working on the same database.
The Issue We have two sites, one domain, we want to setup a virtual
We have two servers in the same network. One of them is the server
I have two separate tables already created and filled with info. The first table
I have a CXF JAX-WS web service operation named diagnosticPing that accepts two params,
I have a database with two tables that are filled with data from parallel

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.