Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need a .htaccess that will show this URL:

but will in fact serve this URL:

Note that action.php can receive other GET parameters in the URL. The htaccess must be able to foward them too. The only difference between these 2 URL is the "fake" root directory which will reflect the "lang" GET parameter.

Is it possible to do such things with a .htaccess (I'm pretty sure it's possible)? Anyone have pointers on how to do this??


Edit1: I forgot to say that the rewrite rule should be only valid for "action.php" that is in "/wp-content/plugins/mailpress/mp-includes/".

Edit2: I have this currently in my .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
share|improve this question
up vote 3 down vote accepted

The following should do the trick

RewriteEngine On
RewriteRule ^/es/(.+)$ /$1

With regard to the edit of your question, here's a modified answer:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/es/wp-content/plugins/mailpress/mp-includes/action.php
RewriteRule ^/es/(.+)$ /$1
share|improve this answer

try this one:

RewriteEngine on
RewriteRule ^/es/(.*) /$1

here is the according documentation from apache.

share|improve this answer
Added Edit2 to question... – AlexV Feb 22 '10 at 15:46
where did you put the rules from dominik's answer? – Christian Feb 23 '10 at 10:03
On the root of the domain, at the end of the existing .htaccess – AlexV Feb 23 '10 at 14:48
try to put it directly behind the RewriteBase line of your .htaccess file. – Christian Feb 23 '10 at 16:09
Still not working... But I think it's WordPress who is messing things up. If I comment the RewriteBase line and following, I get a 404... – AlexV Feb 23 '10 at 16:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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