Php 从.htaccess seo url中删除默认语言

Php 从.htaccess seo url中删除默认语言,php,apache,.htaccess,slug,Php,Apache,.htaccess,Slug,我使用.htaccess重写多语言Url,如下所示: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(fr/en)/(article|page|gallery)/([0-9]+)/([A-Za-z0-9-]+)/?.html$ index.php?page=$2&id=$3&title=$4&lang=$1 [NC,L,QSA] 输出为: http

我使用
.htaccess
重写多语言Url,如下所示:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(fr/en)/(article|page|gallery)/([0-9]+)/([A-Za-z0-9-]+)/?.html$ index.php?page=$2&id=$3&title=$4&lang=$1 [NC,L,QSA]
输出为:

http://localhost/subdomain/fr/article/1/title1.html
http://localhost/subdomain/en/article/2/title2.html
这适用于两种语言
(fr/en)
。我的默认语言是
en
,我需要从slug url中删除
en
,如下所示:

 http://localhost/subdomain/article/2/title2.html
我的意思是从seo url中删除
en
,只针对默认语言
en
。我怎么才能生成这个

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

#Rule for "en"
RewriteRule ^(article|page|gallery)/([0-9]+)/([A-Za-z0-9-]+)/?.html$ index.php?page=$1&id=$2&title=$3&lang=en [NC,L,QSA]
#____________

#Rule for "fr"
RewriteRule ^(fr)/(article|page|gallery)/([0-9]+)/([A-Za-z0-9-]+)/?.html$ index.php?page=$2&id=$3&title=$4&lang=$1 [NC,L,QSA]