WestCoast_BC
asked on
Hiding URLs
Right now my coldfusion website passes variables via the URL. Ie, www.mysite.com?var1=text&var2=number.
Without making changes like changing the anchors to form posts is there any way to hide the variables passed in the URL?
Any help I can get is very much appreciated.
Without making changes like changing the anchors to form posts is there any way to hide the variables passed in the URL?
Any help I can get is very much appreciated.
ASKER
My client would prefer not to display all the variables in the URL. I am hoping not to redesign the whole site to do this.
You would need to change the link to a form submit and put the values in a hidden input tag.
oop, sat on the page too long..
I like agx's suggestion of encoding the values in some way...
The question is, would the like be ok if the values were not readable/understandable, but still there?
If the client wants to avoid having those values bookmarkable, that's a bit more complex as the URL needs to expire as well.
I like agx's suggestion of encoding the values in some way...
The question is, would the like be ok if the values were not readable/understandable, but still there?
If the client wants to avoid having those values bookmarkable, that's a bit more complex as the URL needs to expire as well.
ASKER
How would I encode/decode the URL variables?
ASKER
I just found this link on the web: http://roshanbh.com.np/200 8/04/hide- url-displa y-same-url -website.h tml
Here is his comment:
Is it possible to do this by having my entire website in an iframe?
Here is his comment:
Do you want to hide the actual URL in the address-bar? Do you want to display the same url throughout the website? Then here is the tips for you do the same in your website. Just display the same URL i.e http://www.your-site.com throughout your website in address bar, no matter if you in the page http://www.your-site.com/aboutus.html.
Live Demo
As you can see demo, it displays the same url throughout the browser’s address bar.But you are navigating to different page like aboutus.html or services.html. Ok, too much explanation, now let’s know how to do it.
1) First of create, all the other relavant page like “services.html” or “contactus.html” as usual.
2) For home page, rename the actual index page like “index.html” or “index.php” as “home.html” or “home.php” or whatever name you’re comfortable with.
3)Now, in the index page like “index.html” or “index.php”, put the following code
<iframe src="home.html" width="100%" height="100%" frameborder="0" scrolling="no" />
As, you can see above, we’ve used iframe to display the “home.html” page in the home page by using “src” attribute. The width and height should be “100%” and border should be ” ” for hiding the actual URL from the browser and displaying it so normal.
When a new link is clicked in the page, it gets loaded within “iframe” and displays the same URL throughout the website.
Is it possible to do this by having my entire website in an iframe?
> My client would prefer not to display all the variables in the URL.
Ok, but why? The right approach is going to be dictated by the reason for wanting to hide them. For example, it it's for security, then switching to a form post wouldn't help, because it's just the illusion of security by obscurity.
> it gets loaded within “iframe”
Personally I avoid any kind of frames when possible. iframes make it difficult for users to bookmark pages. Also iframes can have additional security restrictions regular pages don't.
Ok, but why? The right approach is going to be dictated by the reason for wanting to hide them. For example, it it's for security, then switching to a form post wouldn't help, because it's just the illusion of security by obscurity.
> it gets loaded within “iframe”
Personally I avoid any kind of frames when possible. iframes make it difficult for users to bookmark pages. Also iframes can have additional security restrictions regular pages don't.
ASKER
You ask a good question and I don't have the answer. I think it is time to talk to my client to ask why they want the URL hidden.
> to ask why they want the URL hidden.
And the details... is it the page link or specific variables in the query string... if particular values in the query string, which ones?
For example, if the client wants to hide the users ID from the URL, then this could be put into a session variable.
.. as agx said, the answer depends on the reasons/requirements
And the details... is it the page link or specific variables in the query string... if particular values in the query string, which ones?
For example, if the client wants to hide the users ID from the URL, then this could be put into a session variable.
.. as agx said, the answer depends on the reasons/requirements
ASKER
I have finally received feedback about this and they want to hide passed variables in the URL so that it (in their mind) the URL looks 'cleaner'. The problem is that it will not be possible for a user to bookmark pages if the variables are not included in the URL. We have decided to put this feature on hold for now.
This may be a time to look into the friendlier SEO style URL instead of IDs.
For example, if you have a product page that you may have a url..
mySite.com/product_id=1983 873&compan y_id=39834
You could switch it to...
mySite.com/Mircosoft/opera ting-syste ms-windows -7/
Now that we know the intent, that may be a good alternative for you..
For example, if you have a product page that you may have a url..
mySite.com/product_id=1983
You could switch it to...
mySite.com/Mircosoft/opera
Now that we know the intent, that may be a good alternative for you..
ASKER
Thanks for the above but can you explain it some more to me. I don't understand how :
mySite.com/product_id=1983 873&compan y_id=39834
is the same as:
mySite.com/Mircosoft/opera ting-syste ms-windows -7/
mySite.com/product_id=1983
is the same as:
mySite.com/Mircosoft/opera
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
I'm curious - what is your reason for wanting to hide them?