-2

I want my php/apache site to accept requests to a folder that does not exist - when such a request comes in some php code should kick in to create the folder and copy some files into it.

The site is a rudimentary chat site, the client wants users to specify a URL like this:

http://www.mysite.net/custom-chat

This would be like creating a channel. He does not want to do something I know how to do like

http://www.mysite.com/?room=custom-chat

Is this possible?

codefactor
  • 1,616
  • 2
  • 18
  • 41
  • `google://mod_rewrite` – zerkms May 05 '14 at 01:42
  • I guess you do not know the technical keywords for a Google search of your problem. But if you try hard, you should be able to get some insights. E.g.: [php url no question mark](https://encrypted.google.com/search?q=php+url+no+question+mark) – cychoi May 05 '14 at 01:48

1 Answers1

1

You can use mod_rewrite:

RewriteRule ([A-Za-z_]+) /yourscript.php?room=$1 [L,NC]

Requests to yoursite.com/room-blah will be rewritten to your script yoursite.com/yourscript.php?room=room-blah

David Xu
  • 5,555
  • 3
  • 28
  • 50