Is there any wa开发者_开发问答y to hide the number 2, as it will show in the url?
<a href="`http://live_esebd2/user/middle/article_list/2`">Endress and hauser started 50 years</a>
Question is, why would you "hide" it in the first place? What's the goal? Hiding how many entries of something are in your database or is there some other goal? You can turn your integer (number 2 in this case) into a string, such as bit.ly does with its shortening service. That way, to uneducated eye it will be hard to determine what's the meaning of the querystring. You can use Base62 encoding/decoding (googling for php integer base62 should yield more than enough resources). If it isn't what you are looking for, then I absolutely missed the point :)
The question is, why hide it? The number 2 has no meaning to me in the URL, and it probably won't have a meaning to any other visitor. If you want to "hide" it, is it possible to put it in the middle of the URL instead of at the end? I assume mod_rewrite is handling this one, so that should be a possibility.
Another possibility is to go off of the test-based entry that "2" represents, but I dislike that approach as it reduces flexibility.
Finally, The traditional way of hiding data through HTTP request is to use the post method. With post-redirect-get, your users will be none the wiser either. Of course, this creates more work for you and it might eliminate the possibility of people reaching this location directly (if that is desired).
精彩评论