0

I want to catch all URL's in the root folder of the url www.example.com

The url cannot end in a trailing slash, and can't contain any slashes at all.

so these should pass:

www.example.com/abc
www.example.com/abc123-asdf
www.example.com/abc123/  ** FAIL!

also, the sub-folders, like:

www.example.com/asdfsd/asdf  ** FAIL!
Sina
  • 765
  • 1
  • 13
  • 32

1 Answers1

0

What web server are you using? If you're using Apache, what you want is URL Rewriting (mod_rewrite)

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

It has full regular expression support. and can automatically change all offending requests to the default url for you.

dj_segfault
  • 11,957
  • 4
  • 29
  • 37
  • For IIS, you can use ISAPI Rewrite from Helicon, what is equivalent to mod_rewrite for Apache: http://www.isapirewrite.com/ – ARemesal Nov 17 '08 at 09:57