RewriteRule being greedy
- by lardlad
I have been looking for an answer for a few hours now, so sorry if this was asked a ton of times, I missed it.
I basically want to make a rewrite to ignore the first directory. That first dir in the path will be different so I thought I could use a regex. But my regex is matching all the way to the file name:
RewriteRule ^([a-z]+)?/(.+)$ $2 [L]
this works if I am one level deep:
http://test.domain.com/one/index.php
I get the actual index page of the root. Which is what I want. but if I were to go deeper:
http://test.domain.com/one/two/index.php
I get a message saying /index.php was not found. So it seems my regex is not stopping after the last [a-z]. I appreciate any help.
This is Apache2 if that matters at all.