.htaccess-创建语言目录

.htaccess-创建语言目录,.htaccess,url-rewriting,.htaccess,Url Rewriting,对于SEO友好的URL,我使用以下表达式: RewriteRule ^([0-9]+).([^/]+)$ index.php?id=$1&titel=$2 url是domain.com/55-page-title,它工作得非常完美 现在我必须确定不同的语言,我的url应该看起来像domain.com/de/55-seitentiel。我不知道如何在.htaccess文件中重写正则表达式 RewriteRule ^([0-9]+).([^/]+)$ index.php?lan=$1&am

对于SEO友好的URL,我使用以下表达式:

RewriteRule ^([0-9]+).([^/]+)$ index.php?id=$1&titel=$2
url是domain.com/55-page-title,它工作得非常完美

现在我必须确定不同的语言,我的url应该看起来像domain.com/de/55-seitentiel。我不知道如何在.htaccess文件中重写正则表达式

RewriteRule ^([0-9]+).([^/]+)$ index.php?lan=$1&id=$2&titel=$3
我可以在“^”后面插入什么?非常感谢

试试这个:

RewriteRule ^([a-z]{2})/([0-9]+).([^/]+)$ index.php?lan=$1&id=$2&titel=$3