Right.

I have: RewriteRule gallery2/(.+)$ http://www.strictlyreading.co.uk/story/reading-festival-2009/reading-festival-gallery [R=301,L] but if I venture to http://www.strictlyreading.co.uk/gallery2/main.php?g2_controller=cart.Ad... for example, nothing happens.

How can I get it to work?

If I use redirect 301 /gallery2/ http://www.strictlyreading.co.uk/story/reading-festival-2009/reading-festival-gallery, the URL gets sent to: http://www.strictlyreading.co.uk/story/reading-festival-2009/reading-fes...

Any ideas?

Comments

adixon’s picture

Sharing my non-expert understanding of mod rewrite black magic ...

The rewrite rules are intended for converting a users url into an internal url that is processed by the server. So your rewrite probably isn't what you want, since it's rewriting to what looks like a user's url, not the internal one.

Also, i'm confused why you're trying to do a rewrite rule instead of the redirect - it'll probably be clearer if you start your question by giving more context of what you want to do and why.

And finally, as an aside - the times I've been confused about mod rewrite are usually related to the issue of 2-pass processing. It's really kind of non-obvious how mod rewrite ends up processing some combinations of requests. In this case, for example, that rewrite is going to be confused with the usual drupal mod rewrite that would normally turn your destination url into something like index.php?q=. So my general advice is to stay away from mod rewrite unless you've studied the documentation, and you really need it.