Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have the following problem:

The Apache DocumentRoot is /var/www/.

The URL of the file one should get when browsing http://www.example.com/ is http://www.example.com/_www/en/home.html

So I configured a redirect via a RewriteRule:

RewriteRule ^$ _www/de/pub/aktuelles.cfm [R]

Now I don't want the "_www" directory to appear in the URL, but I don't want to rewrite it in every request.

People should see http://www.example.com/en/home.html when they browse to http://www.example.com/

How do I achieve this, I thought of RewriteBase but that seems to be something different. But I guess I need some kind of base rule.

share|improve this question

marked as duplicate by kce, Ward, MadHatter, HBruijn, Ladadadada Jul 23 '14 at 12:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

To loose the _www from the URL simply alter your DocumentRoot to:

DocumentRoot /var/www/_www/

and the Rewrite Rule to match e.g.

RewriteRule ^/?$   /de/pub/aktuelles.cfm  [R]

If you have multiple language variants of the site you may want to look at using the Apache MultiViews facility.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.