Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Hide / Change Browser URL?

Posted on 2005-04-29
11
Medium Priority
?
385 Views
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 www.fred.com/username - which wonderfully looks up the username in a table and if exist ... does a simple <cflocation url="/page_blah.cfm?u=#checkMembers.id#" addtoken="no">

all is well ... but for icing on the cake ... i'd like the redirected URL in the browser to show /www.fred.com/username and not www.fred.com/page_blah.cfm?u=123

does this make sense?
any ideas?
Richard
0
Comment
Question by:rcbuchanan
10 Comments
 
LVL 7

Expert Comment

by:andw928
ID: 13895777
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: http://httpd.apache.org/docs/mod/mod_rewrite.html

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: http://tutorial90.easycfm.com/


Goodluck!
0
 

Author Comment

by:rcbuchanan
ID: 13895809
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 www.fred.com/gbush into www.fred.com/viewuser.cfm?u=123
I JUST want to change the URL displayed - when www.fred.com/viewuser.cfm?u=123 into www.fred.com/gbush ... like an alias or such like.

Any ideas?
R
0
 
LVL 1

Expert Comment

by:BugBoysWorld
ID: 13896087
that would be defiend as your link.  you wouldnt be able to do www.fred.com/qbush but you could do something like www.fred.com/viewuser.cfm?/qbush or www.fred.com/viewuser.cfm?u=qbush.

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....
0
Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

 
LVL 1

Expert Comment

by:duroWRX
ID: 13897348
Instead of

<cflocation url="/page_blah.cfm?u=#checkMembers.id#" addtoken="no">

Couldn't you do:

<cfinclude template=page_blah.cfm">
<cfexit>
0
 

Author Comment

by:rcbuchanan
ID: 13897368
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>
0
 
LVL 7

Accepted Solution

by:
andw928 earned 2000 total points
ID: 13897664
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: http://httpd.apache.org/docs/mod/mod_rewrite.html"

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:

#cgi.query_string#

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

Author Comment

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

R.
0
 
LVL 7

Expert Comment

by:andw928
ID: 13897754
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!

-Matt

0
 

Author Comment

by:rcbuchanan
ID: 13897977
Thanks PinalDave! Appreciate the thoughtfulness.
No, ... I'll find another track for the answer ...
Good day though! :-)
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 13897982
Okey Rick,
Good day!
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

810 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