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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:00:27+00:00 2026-05-11T06:00:27+00:00

Let’s say, on a ColdFusion site, that the user has navigated to http://www.example.com/sub1/ The

  • 0

Let’s say, on a ColdFusion site, that the user has navigated to http://www.example.com/sub1/

The server-side code typically used to tell you what URL the user is at, looks like: http://#cgi.server_name##cgi.script_name#?#cgi.query_string#

however, ‘cgi.script_name’ automatically includes the default cfm file for that folder- eg, that code, when parsed and expanded, is going to show us ‘http://www.example.com/sub1/index.cfm‘

So, whether the user is visiting sub1/index.cfm or sub1/, the ‘cgi.script_name’ var is going to include that ‘index.cfm’.

The question is, how does one figure out which URL the user actually visited? This question is mostly for SEO-purposes- It’s often preferable to 301 redirect ‘/index.cfm’ to ‘/’ to make sure there’s only one URL for any piece of content- Since this is mostly for the benefit of spiders, javascript isn’t an appropriate solution in this case. Also, assume one does not have access to isapi_rewrite or mod_rewrite- The question is how to achieve this within ColdFusion, specifically.

  • 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. 2026-05-11T06:00:27+00:00Added an answer on May 11, 2026 at 6:00 am

    I suppose this won’t be possible.

    If the client requests ‘GET /’, it will be translated by the web server to ‘GET /{whatever-default-file-exists-fist}’ before ColdFusion even gets invoked. (This is necessary for the web server to know that ColdFusion has to be invoked in the first place!)

    From ColdFusion’s (or any application server’s) perspective, the client requested ‘GET /index.cfm’, and that’s what you see in #CGI#.

    As you’ve pointed out yourself, it would be possible to make a distinction by using a URL-rewriting tool. Since you specifically excluded that path, I can only say that you’re out of luck here.

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

Sidebar

Related Questions

Let me try to explain what I need. I have a server that is
Let's say I'm writing a PHP (>= 5.0) class that's meant to be a
Let's say that we have an ARGB color: Color argb = Color.FromARGB(127, 69, 12,
Let's say that I have an arbitrary string like `A man + a plan
Let's say that I'm currently designing an application where I will need to use
Let's say I have a table that looks something like this: ------------------------------- id|column2|column3 |column4
Let's say you create a wizard in an HTML form. One button goes back,
Let's say I'm building a data access layer for an application. Typically I have
Let's say you have a class called Customer, which contains the following fields: UserName
Let's say we have a simple function defined in a pseudo language. List<Numbers> SortNumbers(List<Numbers>

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.