我试图实现以下目标:
重写:
http://url.com?subfolder=folderone/foldertwo/folderthree
要:
http://url.com/subfolder/folderone/foldertwo/folderthree
在PHP中调用$_GET['subfolder']
,它应该检索folderone/foldertwo/folderthree
这在定义?subfolder=
时按预期工作,但在尝试查找具有该路径的文件夹时未按照以下方式工作:
RewriteEngine on
RewriteRule ^subfolder/([^/.]+)/?$ index.php?subfolder=$1 [L]
上述情况可能吗?
谢谢!
答案 0 :(得分:0)
使用这个:
RewriteEngine on
RewriteRule ^subfolder/(.*)$ index.php?subfolder=$1 [L]