改变可见url,但保持旧的重定向


Change visible url but keep old redirect

我有一个静态网页。它包含3种语言。每种语言都是单独的文件夹。我有文件夹eng de和hr。在每个文件夹我有index.php, exapmle1.php, example2.php等。我有。htaccess,里面有:

RewriteEngine on
RewriteBase  /
redirect 301 /index.php http://www.example.com/eng/

所以我需要的是在我进入文件夹的时候删除它。我:

  http://www.example.com/eng/index.php

 http://www.example.com/de/index.php

and I need:

  http://www.example.com/index.php

我试图删除eng,但当我点击语言选择器时,我需要能够进入另一个文件夹。

 RewriteCond %{THE_REQUEST} ^[A-Z]{3,}'s/+eng/([^'s]+) [NC]

谁能给我点提示吗?

编辑:

现在我有了url:

example.com/hr/index.php
example.com/eng/index.php
example.com/de/index.php
example.com/hr/aboutus.php
example.com/eng/aboutus.php
example.com/de/aboutus.php

所以你可以猜到我的文件结构中有3个文件夹。我有eng, de和hr文件夹,其中有index.php和about .php文件。

我有html 'a'元素,导致文件如hr/index.php, eng/about .php等

我需要改变url,它应该显示如下:

  example.com/hr/index.php

  example.com/naslovna

  example.com/eng/index.php

  example.com/home
  example.com/eng/aboutus.php

  example.com/aboutus

毕竟我发现这是可行的:

RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1'.php [L]
RewriteCond %{HTTP_HOST} ^www'.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
RewriteRule ^page-name/?$   index.php?page=page-name