0

Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?

I am looking for a recipe for a mod_rewrite rule that will accomplish this:

MOD_REWRITE recipe: /agencyname TO /appname/login.jsp?a=agencyname

djangofan
  • 4,200
  • I am going to have to re-enter this one because it doesn't answer my question and neither does the reference as a dupe. – djangofan Apr 27 '11 at 18:03

1 Answers1

1
RewriteEngine On
RewriteRule ^/(.*)        /appname/login.jsp?a=$1

should be your solution.

EEAA
  • 109,904
  • This didn't work for me. I created a directory called "appname" off the root of my site and then tried your rule with http://localhost/appname but all it does is show me the contents of the "appname" directory. The rule doesn't fire. – djangofan Apr 27 '11 at 17:47
  • This doesn't answer my question since it doesnt cover the case if someone entered /appname/xxxx as the URI. in that case i would still only want to pass "appname". – djangofan Apr 27 '11 at 18:05
  • @djangofan well that requirement wasn't in your question. We're not mind readers. And yes, @Stefan's solution is correct. There may be something wrong with how you're testing it, though. – EEAA Apr 28 '11 at 03:23