0

私はそのようなURLを持っています:

http://example.com/directory/index.php?q=anything 

PHP が $_GET['q'] を使用してテスト変数をロードするようにします。

.htaccess でこれを単純化したい:

http://example.com/directory/anything.html

どうすればこれを行うことができますか?

4

2 に答える 2

1

このようなものを追加することができます.htaccess

RewriteEngine on

RewriteRule ([0-9A-Za-z-\+._]+)\.html$ ./index.php?q=$1
于 2013-03-25T06:06:32.030 に答える