Htaccess在URL中添加单词

时间:2013-12-10 16:00:14

标签: php .htaccess

htaccess专家需要???

如何制作这样的网址

之前:     zohaibbadarpura.com/anypage

之后: zohaibbadarpura.com/eng/anypage?

我尝试过很多东西,但是可以找到任何可以简化的方法,因为我不是“htaccess”的专家,在此先感谢。

尝试

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule /? eng/ [R=301,L] # Force people to the "eng" folder 
  RewriteRule eng/?$ index.html # Make "eng" load the index
</IfModule> 

1 个答案:

答案 0 :(得分:2)

尝试此规则:

RewriteEngine on

# Force people to the "eng" folder
RewriteRule !^eng/ /eng%{REQUEST_URI} [NC,L]