Um ........ do you mean domain1 and domain2 are the same thing? What's "that place" and what's "that subfolder"? If they really are the same then all you need to do is configure the server to serve both names from the same place in the file system. Whatever - it sounds like server configuration, not PHP.