I have a multi-language website and my second language goes to a subdirectory mysite.com/en/ Everything is fine but the search functionality. When I submit my search, it prints a question mark right after the subdirectory like this:


And because of it my site redirects to the homepage. I searched and tried many .htaccess codes but it did not work. The URL without question mark works fine. besides i set the "Force URL query strings" to "No" in admin panel but still not working. Here is my .htaccess:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /en/

  # Removes index.php from ExpressionEngine URLs
  RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
  RewriteCond %{REQUEST_URI} !/system/.* [NC]
  RewriteRule (.*?)/index\.php/*(.*) /$1$2 [R=301,NE,L]

  # Directs all EE web requests through the site index file
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

i don't know what to do

1 Answer 1


You need some .htaccess magic. This should do the trick, but might need tweaking based on your URL needs. Make sure you put this before your EE rewrites and index.php redirects.

RewriteCond %{THE_REQUEST} ^(GET|HEAD)\ /en/\?([^\ ]+)
RewriteRule ^ /en%2? [L,R,NE]

The problem is systemic to something else, so this is probably more of a band aid, but should work for you.

  • oh my god, thank you so much, it worked very nice, thank you ;) Commented Apr 28, 2015 at 14:45
  • No problem Hossein! Glad to help.
    – jrothafer
    Commented Apr 28, 2015 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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