.htaccess tutorial

htaccess Elite


Only one level

Ask your mod_rewrite and Redirection questions here, and get answers!

Only one level

New postby gemal » 16 Dec 2007 16:54

I want to write a RewriteCond and only works on one level so that:

1)
http://blabla.com/
gets redirected

2)
http://blabla.com/test/
gets redirected

3)
http://blabla.com/about/test/
doesn't gets redirected

I've tried:
RewriteCond %{REQUEST_URI} ^/.*/(test)? [nocase]

but the .* takes 3) also which is an error.
I've tried .*? but non greedy doesn't work. Produces error 500

Anybody have an answer?
gemal
 
Posts: 1
Joined: 16 Dec 2007 16:47

Return to Redirect or Rewrite Questions