php - Rewrite first level subfolders that do not have trailing slash htaccess -


I am wondering how can I rewrite the first level sub-folders, in which a rewrite No previous slash of php file.

For example

  / test - & gt; Re-writes File.php? Id = test / test - - Is following the slash so that it is normally test / test / test- & gt; The second level is in the sub folder so that it is normally test / test / - & gt; The homepage has to be followed as usual for index.fp  

, trying to think about a rule 1 for the above example in the line, the test is just one example And the rule should rewrite any string. You can use this code in the DOCUMENT_ROOT / .htaccess file:

  Revivedignment on rev.ababase / reiterate rule ^ ([^ /.] +) $ File.php? Id = $ 1 [L, QSA]  

Comments