views:

153

answers:

2

Hi,

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!

www.example.com/asdfsd/asdf ** FAIL!

+1  A: 

Already Asked

David P
A: 

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
For IIS, you can use ISAPI Rewrite from Helicon, what is equivalent to mod_rewrite for Apache: http://www.isapirewrite.com/
ARemesal