[Phpwm] Mod rewrite question

David Goodwin david at codepoets.co.uk
Tue Apr 1 12:02:19 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Mike Tipping wrote:
| I have a client who because most of their site is out of date wants to
| redirect all english and french pages to one external site, all german
pages
| to another external site but still allow people to access the admin pages
| and a specific campaign section called ebook.
|
| The site is structured like:
|
| /en/...
| /fr/...
| /de/...
| /admin/...
| /ebook/...
| /other/..
| /etc/
| /etc2/
|
| I presume this is possible with Mod rewrite but everything I try gets the
| whole site to redirect rather than leaving the admin and ebook links
| working.
|
| Any help appreciated.
|


I don't see why you can't do something like :

RewriteRule ^/en/(.*) http://foo.bar/$1 [LC]
RewriteRule ^/fr/(.*) http://french.bar/$1 [LC]

In either a .htaccess in the root of the site, or in Apache's main
configuration.

(I think that's syntactically right, but haven't bothered checking it)
(You might want to improve the regexp, so ^/en matches too etc)

David.
- --
David Goodwin

[ david at codepoets dot co dot uk ]
[ http://www.codepoets.co.uk       ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH8hYs/ISo3RF5V6YRAkhwAKDiy69bPNnLfZDF5ZEhwhe8q5EvHACfZbzz
uEXEsM15NwOT1eW+NjFuOc0=
=b5rH
-----END PGP SIGNATURE-----



More information about the Phpwm mailing list