我在编写 .htaccess 时遇到问题,以帮助我处理来自root的请求,即http://domain.com/index.php可以处理用户对来自孩子的http://domain.com/abc/的请求文件夹中。
因此,为了澄清,我希望每次用户转到http://domain.com/abc/
时,http://domain.com/index.php
中的代码都会像处理http://domain.com/index.php?url=abc
一样处理GET请求。
我没有太多使用.htaccess的经验,希望有人可以帮助我:)。
感谢。
答案 0 :(得分:0)
在.htaccess文件中尝试此代码:
Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteRule ^(abc)/?$ index.php?url=$1 [L,NC,QSA]
请注意,上述规则仅适用于URI /abc
或/abc/
。