使用htaccess将根查询重定向到另一个文件而不是directoryindex

时间:2019-04-17 17:55:00

标签: .htaccess

我将查询直接发送到我的域example.com/?s=Xy1Ab(S是随机的,像Xy1Ab一样长5个字符),但我希望DirectoryIndex是index.html,但我想将此查询字符串重定向到index.php但它似乎不起作用。

DirectoryIndex index.html
RewriteEngine   On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{QUERY_STRING} ^s=(.*?){5}
RewriteRule ^(.*)$ /index.php?s=%1? [R=302,L]

0 个答案:

没有答案
相关问题