【发布时间】:2017-05-08 08:36:56
【问题描述】:
我有一个类似的网址:
http://localhost/admin-s/index.php?m=user
但是,我想要这样的网址:
http://localhost/admin-s/user
我尝试这样:
RewriteRule ^([a-z0-9]+).php$ index.php?nol&m=$1 [L]
RewriteCond %{QUERY_STRING} ^m=([a-zA-Z0-9]+)$
RewriteRule ^index.php$ user%1.php [L]
如何制作?
【问题讨论】:
-
不清楚你想做什么:你想将
http://localhost/admin-s/index.php?m=user重写为http://localhost/admin-s/user(如果是这样,你想只是内部重写还是重定向?)或另一种方式?这两个应该是用户在浏览器中看到的 URL? -
我使用了 ajax,在文件夹用户中,我有三个文件:user.php(这就像 index.php),user_crud.php(用于 php 中的 CRUD),user_ss.php(服务器端),我希望用户只看到 localhost/admin-s/user