views:

137

answers:

2

I need to redirect users from http://myurl.com/Login.action to http://myurl.com/app/Login.action

I tried this but I get an error saying I get too many redirects.

RedirectMatch ([A-Za-z]*)\.action$ http://myurl.com/app/$1.action

How can I get apache to redirect to the same URL but only redirect once.

Would something like this work?

RedirectMatch ![app\/]([A-Za-z]*)\.action$ http://myurl.com/app/$1.action
+5  A: 

your regular expression matches both urls, so you're redirecting in an infinite loop.

Try something like this:

RedirectMatch ^([^\/]+?\.action)$ http://myurl.com/app/$1
Rob
For some reason that didn't work for me.
Trevor Allred
A: 

Rob, thanks for your guidance. I modified yours a bit and this is what I came up with.

RedirectMatch ^\/([A-Za-z]+\.action)$ http://myurl.com/app/$1
Trevor Allred