62

I want to know what is .do extension in web pages. Is it a standard extension, or, if it's not, can we change the extension (like client-login.php to client-login.do and still run as PHP)?

Thanks.

Lucas
  • 15,579
  • 27
  • 98
  • 170
Vishwanath Dalvi
  • 31,604
  • 36
  • 115
  • 146
  • possible duplicate of [Which programming language has extension .do](http://stackoverflow.com/questions/5973505/which-programming-language-has-extension-do) – DisgruntledGoat Aug 07 '14 at 16:37
  • Possible duplicate of [What does .do webpage stands for](http://stackoverflow.com/questions/3117694/what-does-do-webpage-stands-for) – Bae Jan 09 '17 at 04:17

5 Answers5

164

.do comes from the Struts framework. See this question: Why do Java webapps use .do extension? Where did it come from? Also you can change what your urls look like using mod_rewrite (on Apache).

Community
  • 1
  • 1
MK.
  • 31,408
  • 15
  • 67
  • 104
46

".do" is the "standard" extension mapped to for Struts Java platform. See http://struts.apache.org/ .

beactive
  • 749
  • 1
  • 7
  • 12
35

It is whatever it is configured to be on that particular web server. A web server could be configured to run .pl files with the php module and .aspx files with perl, although that would be silly. There are no scripts involved with most web servers, instead you'd have to look in your apache configuration files (or equivalent, if using different server software). If you have permission to edit the server config file, then you could make files ending in .do run as php, if that's what you're after.

Ben Voigt
  • 260,885
  • 36
  • 380
  • 671
  • 4
    Yeah - in the end, a web server is just a program, and it can do whatever it feels like to come up with its content. It doesn't have to mirror the filesystem, though your standard basic web server setup does work on that model because it's awfully convenient. A good application will more often than not have some measure of abstraction between the URL and the actual actions, too. –  Dec 26 '10 at 04:52
  • 21
    While this answer is true, I think the real question is what technology are they most likely using. Which is answered by MK below. It looks like they are probably using Java and the Structs framework. – Luis Perez Mar 20 '13 at 15:20
  • 2
    @luisperezphd: It looks to me like Vishwanath wanted to hide what language he is using, and he saw that some other websites use `.do`, and wanted to know if he could similarly obfuscate his filenames. The question is tagged `php` after all. – Ben Voigt Mar 20 '13 at 15:32
3

Using apache's rewrite_module can change your script extensions. Give this thread a good read.

Babiker
  • 16,998
  • 26
  • 70
  • 119
-2

I've occasionally thought that it might serve a purpose to add a layer of security by obscuring the back-end interpreter through a remapping of .php or whatever to .aspx or whatever so that any potential hacker would be sent down the wrong path, at least for a while. I never bothered to try it and I don't do a lot of webserver work any more so I'm unlikely to.

However, I'd be interested in the perspective of an experienced server admin on that notion.

scaiferw
  • 19
  • 3