2015-04-23 98 views
0

我有一个多语言网站,我的第二种语言转到子目录mysite.com/en/。一切都很好,但搜索功能。当我提交我的搜索,它打印一个问号像这样的子目录之后:expressionengine搜索提交后从网址中删除问号

mysite.com/en/?/noresult/6bc629a9319d90a1e9703eaf2c00f7cd/ 

而且因为它我的网站重定向到主页。我搜索并尝试了很多.htaccess代码,但它没有奏效。没有问号的URL可以正常工作。

这里是我的.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 ^(.*)$ /en/index.php?/$1 [L] 
    RewriteRule ^(.*)$ /en/index.php?/$1 [L,QSA] 
</IfModule> 

请有人可以帮助我?

回答

0

你需要保持目录削减掉,然后添加使用重写规则结尾的斜线:

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

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

    # add a trailing slash to directories 
    RewriteCond %{REQUEST_METHOD} !POST 
    RewriteCond %{DOCUMENT_ROOT}/en/$1 -d 
    RewriteRule ^(.*?[^/])$ /en%{REQUEST_URI}/ [L,NE,R=302] 

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

感谢,但它没有工作,但它仍然像以前 –

+0

尝试在新的浏览器我更新的代码。 – anubhava

+0

我检查过,同样的问题 –