查询参数中的路径附加到 .htaccess 中的 url
path in query parameter append to url in .htaccess
我正在尝试制作以下内容 url
重定向到
http://localhost/base/list.php?r=path/to/redirect/1-2-master
这个我试过了。但是我收到 404 错误。
RewriteEngine On
RewriteRule ^(.*)base/(.*)/list.xh$ base/list.php?r= [NC,L]
但是当我在 http://htaccess.mwl.be/ 上测试时它工作正常
假设没有 base/.htaccess
你可以在 root .htaccess 中使用这个规则:
RewriteEngine On
RewriteRule ^(base)/(.+)/list\.xh$ /list.php?r= [L,QSA,NC]
我正在尝试制作以下内容 url
重定向到
http://localhost/base/list.php?r=path/to/redirect/1-2-master
这个我试过了。但是我收到 404 错误。
RewriteEngine On
RewriteRule ^(.*)base/(.*)/list.xh$ base/list.php?r= [NC,L]
但是当我在 http://htaccess.mwl.be/ 上测试时它工作正常
假设没有 base/.htaccess
你可以在 root .htaccess 中使用这个规则:
RewriteEngine On
RewriteRule ^(base)/(.+)/list\.xh$ /list.php?r= [L,QSA,NC]