0

Using ISAPI Rewrite I'm looking for a way to detect if a given URL contains only one subfolder and then rewriting the URL.

www.mysite.com/Cloud     => true
www.mysite.com/Cloud/    => false
www.mysite.com/Cloud/One => false
www.mysite.com/Cloud.xml => false

the result should be the URL added with .html only for the true condition

www.mysite.com/Cloud.html
LazyOne
  • 158,824
  • 45
  • 388
  • 391
jvzoggel
  • 31
  • 3

1 Answers1

0

Try using the following:

RewriteEngine on
RewriteBase /

RewriteRule ^([^/]+)$ $1.html [NC,L]

You did not specify if it's a 301-redirect or a rewrite. So in case it's 301-redirect, simply add R=301 in flags.

Andrew
  • 511
  • 3
  • 7