apache - What's wrong with this mod_rewrite statement? -


I need to repeat the functionality of mod_alias , which I can not use directly because I On shared hosting, and nickname statements Do not work in Htaccess.

What I want to achieve is essentially

  surname / manual / www / customer / some_other_dir / manual  

i try Am mod_rewrite:

  RewriteRule ^ / manual /(.*) / www / customer / some_other_dir / manual /% 1?% {QUERY_STRING}} [L]  

This will not match any call at www.example.com/manual .

Why not? What am i doing

Try:

  RewriteRule ^ / manual (/ (. *))? $ / Www / customer / some_other_dir / $ 2 [L]  

? means to ensure optional / < / manual , / manual / and / manual / A. In addition to cloning cloning on / code> Character / B / c Although I collect a slash, generally an Apache pre-rewrite is added by the engine.

A quick test on my box shows that this rule also passes the query string:

  / manual / a / b? C = d - & gt; / Www / customer / some_other_dir / manual / $ 2  

Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -