我有多种语言,但由于我改变了网址的结构,我不得不做出一些改动,但它不起作用,也许有人可以弄清楚缺少什么:
我的网址看起来像这样:
http://example.com/jobs-country-city-title-123.html
并且需要像
http://example.com/en/jobs-country-city-title-123.html
或
http://example.com/es/jobs-country-city-title-123.html
代码:
Options +FollowSymLinks
RewriteEngine on
RewriteRule /(es|en|pt)/jobs-(.*)-(.*)-(.*)-(.*)\.html$ job.php?lang=$1&country=$2&city=$3&title=$4&id_job=$5
答案 0 :(得分:1)
未经测试,但也许
RewriteRule ^(es|en|pt)/jobs-([a-zA-Z]+)-([a-zA-Z]+)-([a-zA-Z]+)-([0-9]+)\.html$ /job.php?lang=$1&country=$2&city=$3&title=$4&id_job=$5 [NC,L]