tuvok
05-27-2002, 12:26 PM
Also does anyone know how this same code would be applied in ASP
;)
;)
![]() | View Full Version : me again tuvok 05-27-2002, 12:26 PM Also does anyone know how this same code would be applied in ASP ;) mwatkins 05-27-2002, 12:35 PM You should just search the web using Google for strings like "ASP file open function" Would be a good idea for you to pick up some introductory language reference books on both PHP and ASP as well. or do it right and learn Python instead. Also starting a new thread with "me again" and "how do I do the same thing in ASP" will help no one answer you since they do not know the context of your request unless they happen to note two threads started by you. For long term success, might I suggest two things: 1. At least make an attempt to find your own answers 2. If you need to ask questions, think first before asking. Highly recommended reading: How To Ask Questions The Smart Way http://www.tuxedo.org/~esr/faqs/smart-questions.html sam.moses 05-28-2002, 07:51 PM It's funny, I was just researching this issue. I found a couple of ways of doing it with and without components. But the most promosing thing I happened across was here http://www.webmasterworld.com/forum5/762.htm Good luck mwatkins 05-28-2002, 10:18 PM Sam.moses - Was that a question? Why make it so hard for someone to understand what you are trying to accomplish? What if you did it through XMLHTTP? Did what? Fry chicken? Smoke salmon? Sand a floor? Do you not understand my point? Learn to ask intelligent questions if you want to get answers. I'm not trying to be rude, just helpful. If you tell us - what are you attempting to achieve, not how you think it should or might be done Then people can help. If you have issues / errors problems, then also add: - what you have done - what is failing, with descriptive detail including error messages and logs - accurate detail! Its all really simple. mwatkins 05-28-2002, 10:21 PM Now, on to "did this..." - given the link are we to infer that what you are trying to do is have good looking URLs with query strings like http://mydomain.com/users/343/edit instead of http://mydomain.com/users?mode=edit&userid=343 ? Depending on your environment this can be done in different ways. In Apache, mod_rewrite is a simple way to achieve the above. In ASP / Microsoft IIS, there in fact is a tool similar to mod_rewrite - perhaps you should investigate. sam.moses 05-28-2002, 10:46 PM Originally posted by mwatkins Sam.moses - Was that a question? Why make it so hard for someone to understand what you are trying to accomplish? Did what? Fry chicken? Smoke salmon? Sand a floor? Do you not understand my point? Learn to ask intelligent questions if you want to get answers. I'm not trying to be rude, just helpful. If you tell us - what are you attempting to achieve, not how you think it should or might be done Then people can help. If you have issues / errors problems, then also add: - what you have done - what is failing, with descriptive detail including error messages and logs - accurate detail! Its all really simple. So Sorry, I was under the impression that this thread was about cloaking your actual dynamic URL, and replacing it with a static looking one. Assuming that is what this thread is about, I had the idea that it could be done with a 404 handler that loads and proccesses URL's from a remote http location via Microsoft XML 3 or 4 on a windows box. I found the idea entertaining. But maybe there is something you could help with. The following script is complete in every respect but redirection. If you could fix the server.transfer line in it, you would have a fully functional 404 handler/URL changer for a windwos box. The code (asp/vbscript): <% response.status = "200 OK" THEURL = lcase(request.servervariables("QUERY_STRING") ) VirtualPage = THEURL VirtualPage = VirtualPage & "" VirtualPage = Replace(VirtualPage, "404;http://"&Request.servervariables("server_name")&"/", "") VirtualPage = Replace(VirtualPage, "/ex/", ".asp?") VirtualPage = Replace(VirtualPage, "/and/", "&") VirtualPage = Replace(VirtualPage, "/is/", "=") VirtualPage = Replace(VirtualPage, "index.html", "") 'Response.write VirtualPage 'Behold the problematic line 'Server.Transfer VirtualPage %> How to use it (if it worked, lol): Say for example you have a URL that looks something like: http://mysite/somrthing.asp?thisvalue=this&thatvalue=that The modified URL would theoretically look like: http://mysite/something/ex/thisvalue/is/this/and/thatvalue/is/that/index.html mwatkins 05-28-2002, 11:41 PM So take out the server.transfer call for a second and just write the VirtualPage string to output. i.e. just write it out Response.write(VirtualPage) and have a look at the output. Is it complete? sam.moses 05-28-2002, 11:49 PM Originally posted by mwatkins So take out the server.transfer call for a second and just write the VirtualPage string to output. i.e. just write it out Response.write(VirtualPage) and have a look at the output. Is it complete? Yes, I know what the response.write does, I wrote the script. sam.moses 05-28-2002, 11:50 PM should be complete aside from the error it generates on transfer. |