httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Krist van Besien <>
Subject Re: [users@httpd] Redirecting URLs and directory structure
Date Thu, 08 Oct 2009 08:45:35 GMT
On Wed, Oct 7, 2009 at 3:29 PM, "Fábio Jr." <> wrote:

> 1st question: is there a way of making a request to
>, Apache will redirect or treat this
> URL for the correct path through a regular expression?

You can use mod_rewrite for this, and it is entirely up to you if you
want this done with a redirect that is visible to the outside or not.

For example:

This will rewrite internally. To the outside world nothing changes:
RewriteRule /images/(.*)(.)(..)\.png     /newimages/$2/$3/$1$2$3.png

This will cause a redirect:
RewriteRule /images/(.*)(.)(..)\.png     /newimages/$2/$3/$1$2$3.png   [R]

If you do a redirect you need to worry about loops, which is why I
suggest you use a different basedir for your new images structure.

You can read about mod_rewrite here:

Study this documentation and if you have any questions left after that
feel free to ask here...


Bremgarten b. Bern, Switzerland
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message