htaccess RewriteCond不工作,重定向太多

时间:2018-02-09 04:38:20

标签: apache .htaccess

我正在尝试使用以下规则将public SecretKey retrieveKey(String password, byte[] certFile) throws Exception { try { String alias = null; certPass = password; char[] pass = certPass.toCharArray(); KeyStore keyStore = KeyStore.getInstance("jceks"); InputStream inputStream = new ByteArrayInputStream(certFile); keyStore.load(inputStream, pass); Enumeration enumeration = keyStore.aliases(); while (enumeration.hasMoreElements()) { alias = (String) enumeration.nextElement(); } Certificate cert = keyStore.getCertificate(alias); Key key = cert.getPublicKey(); aesSecretKey = new SecretKeySpec(key.getEncoded(), algorithm); byte[] encoded = aesSecretKey.getEncoded(); byte[] encryptionKey = Arrays.copyOfRange(encoded, encoded.length - 16, encoded.length); aesSecretKey = new SecretKeySpec(encryptionKey, algorithm); } catch (IOException e) { throw e; } catch (Exception e) { throw e; } return aesSecretKey; } 重定向到/index.php?dir=dir1/dir2

/dir1/dir2

但它没有按预期工作,它还将RewriteEngine on RewriteCond %{QUERY_STRING} ^dir=(.+)$ RewriteRule ^/?index.php$ /%1? [R,L] 重定向到/dir1/dir2,似乎/dir1/dir2无效。

这是我在计算机上进行的测试

RewriteCond

$ curl -I http://localhost.test/index.php?dir=dir1/dir2 HTTP/1.1 302 Found Location: http://localhost.test/dir1/dir2 ...

/dir1/dir2

0 个答案:

没有答案