Hide / Change Browser URL?

Posted on 2005-04-29
Last Modified: 2013-12-24
Is there anyway to change the displayed URL for a web page? (like an alias or such like?)

Reason: I have member defined pages on my web site that are called via /fred.cfm?u=123 where 123 is the user's unique id.

this is not very friendly ... so (with the help of EE) I found a great way to enable users to call their user page easily via - which wonderfully looks up the username in a table and if exist ... does a simple <cflocation url="/page_blah.cfm?" addtoken="no">

all is well ... but for icing on the cake ... i'd like the redirected URL in the browser to show / and not

does this make sense?
any ideas?
Question by:rcbuchanan
    LVL 7

    Expert Comment

    You cannot do that without tuning the server. If you are running Coldfusion on Apache web server then you might want to look into Apache's mod_rewrite. The url is:

    The best you can do programmatically is something like: index.cfm/username/190 or index.cfm/username/190.html. You can find a tutorial on this over here:


    Author Comment

    Hmm. not sure you understood my question;
    is there anyway to modify the displayed url in the brower's address bar?AFTER the page has been loaded.

    again - I've successfully managed to translate into
    I JUST want to change the URL displayed - when into ... like an alias or such like.

    Any ideas?
    LVL 1

    Expert Comment

    that would be defiend as your link.  you wouldnt be able to do but you could do something like or

    you need to see how you are creating the link to viewuser.cfm and change it there. there are other ways to hide the id like using a post a post....
    LVL 1

    Expert Comment

    Instead of

    <cflocation url="/page_blah.cfm?" addtoken="no">

    Couldn't you do:

    <cfinclude template=page_blah.cfm">

    Author Comment

    never mind,
    i didn't explain myself properly; so 'no' ... i NEED the ?u=
    THAT is the POINT. these are dynamic URLS called after the url is trapped and compared against the user database.

    NEVER mind ... i'll stick with my solution as is.

    thanks folks but I'll ask for this question to be closed UNRESOLVED>
    LVL 7

    Accepted Solution

    What you mean it is not resolved? It is resolved, like I said in my first post:

    "You cannot do that without tuning the server. If you are running Coldfusion on Apache web server then you might want to look into Apache's mod_rewrite. The url is:"

    You cannot do what you want to do without tuning the server. And if you want to tune the server, then there you go I gave you the URL to apache's mod_rewrite to be able to do it.

    You cannot edit something in the address bar, if that is what you mean. Once again, the only way to do it would be via mod_rewrite or server url rewrite tools.

    And the closest you would get without modifying server settings, would be this: folder/?username. You cannot do: folder/username. Since the server will thing that is a folder, not a file.

    If you want to do folder/?username you would do this:

    <cflocation url="folder/?#username#" addtoken="no">

    Then on folder/index.cfm, you would retrieve the username by doing this:


    Which would give you the #username# part of the URL.

    Author Comment

    have the 500 points.
    i'm not looking for a solution any more. my need is not understood on this point.  thank you.

    LVL 7

    Expert Comment

    Well, if you want you can re-explain it in even more detail, I can still try to help you if you want. I didn't want to take those 500 points from you like that, but if you give them to me then Thanks dude! I appreciate it!



    Author Comment

    Thanks PinalDave! Appreciate the thoughtfulness.
    No, ... I'll find another track for the answer ...
    Good day though! :-)
    LVL 22

    Expert Comment

    Okey Rick,
    Good day!

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Script 12 98
    Unsearchable in Google,Yahoo and Bing. 6 51
    Has my website been infiltrated? 21 45
    spamming  on Hosted svrs? 6 29
    This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now