0
我正在寻找,但我无法做到这一点。.htaccess - 删除index.php,使用多个参数重定向
我有以下.htacess
RewriteEngine on
# Rewrite request URL
# Input: index/VIDEO/
# Output: index.php?id=VIDEO
RewriteRule ^(\w+)/?$ index.php?id=$1
它做工精细改变以下网址:
https://subdomain.domain.com/path/to/index.php?id=234556
要
https://subdomain.domain.com/path/to/234556
但我已经添加了第二个参数(许可证),所以我需要重写以下URL:
https://subdomain.domain.com/path/to/index.php?id=234556&license=23432532
要
https://subdomain.domain.com/path/to/234556/23432532
或者
https://subdomain.domain.com/path/to/234556&license=23432532
我一直在努力通过多种方式在这里寻找,但我不能做这项工作。
感谢您的回答。我得到“对象在Xampp没有位置”。我使用RewriteRule ^([^ /。] +)/(。*?)$ /index.php?id=$1&license=$2 [L,QSA] Url to test: http:// localhost/api/source/videos/28652187/23432324 – Kokox
在'index.php'之前删除'/'。试试这样:''RewriteRule ^([^ /。] +)/(。*?)$ index.php?id = $ 1&license = $ 2 [L,QSA]' – Thamilan
顺便说一句,我无法测试你的'localhost' URL :) – Thamilan