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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:01:22+00:00 2026-05-20T15:01:22+00:00

I have a site with a short url domain with an A record pointing

  • 0

I have a site with a short url domain with an A record pointing to the main site (it’s a pain to change this so I’d rather not). I have special logic that needs to run when the application is accessed from the short URL.

Right now, I have Apache set up with a RewriteRule to do a 301 to the main site when you hit the short URL, but if I try to access the referrer or any sort of headers they seem to be gone. I can get around this by appending a query parameter, but I’d rather not muddy up the URL as well. Any ideas on how to set some piece of data within Apache that I can access in my Rails app to tell if the request was a result of accessing the short URL?

  • 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-20T15:01:23+00:00Added an answer on May 20, 2026 at 3:01 pm

    As the referrer is entirely client-side, you only have two options (other than the query string):

    1. Allow Rails to handle the redirect for you, instead of Apache, and store some information in the user’s session.

    2. Use the cookie RewriteRule option. RewriteRule has a cookie/CO option that allows you to send a Set-Cookie down to the browser, along with the redirect response. The format of the option is: cookie|CO=NAME:VAL:domain[:lifetime[:path]]. See the RewriteRule documentation for more details.

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

Sidebar

Related Questions

i have a input[type=text] containing the short url for a post. i want to
I am not very experienced with PHP. I have a site I'm maintaining that
So I have this program that fetches a page using a short link (I
So I have this program that fetches a page using a short link (I
I'm using a proxy-like short domain in conjunction with my site. The short domain
Lets say I have a simple ecommerce site that sells 100 different t-shirt designs.
I want to have something on my site that follows the mouse around, sort
I have a site in rails and want to have site-wide settings. One part
For example I have site http://localhost/site In IIS I set that 404 error causes
So I have site list on certain pages that basically just have links to

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.