I am trying to find the correct mod_rewrite code for the following case:
domain.de => www.domain.com/de/
domain.de/... => www.domain.com/...
www.domain.de => www.domain.com/de/
www.domain.de/... => www.domain.com/...
domain.com => www.domain.com/en/
domain.com/... => www.domain.com/...
www.domain.com => www.domain.com/en/
www.domain.com/... => www.domain.com/...
so basically
- all non-www domains should be redirect to www.
- all uri's ending on .de or .de/ should be redirected to www.domain.com/de/
- but if somebody enters something after the .de/ that should be simply appended to www.domain.com/...
Can anyone think of a clever solution for this? I have been struggling with {REQUEST_URI} and {REQUEST_FILENAME} trying to figure out if the requested URI ends on .de or .de/ but couldn't find a working solution...