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

I need a .htaccess that will show this URL:

http://www.mysite.com/es/wp-content/plugins/mailpress/mp-includes/action.php?action=mail_link&add=123&lang=es

but will in fact serve this URL:

http://www.mysite.com/wp-content/plugins/mailpress/mp-includes/action.php?action=mail_link&add=123&lang=es

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??

Thanks!

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]
</IfModule>
# END WordPress
share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.