1

好的,在我的网站上,我希望它是这样,当人们访问http://mysite.com/201209041时,它将重定向到 http://mysite.com/[前 4 位数字]/[接下来的两位数字]/[接下来的两位数字]/[所有其他数字]/index.html 所以在我的例子中它会重定向到http://mysite.com/2012/09/04/1/index.html 而在另一个例子中是 http://mysite.com/ 20120904259872 将重定向到 http://mysite.com/2012/09/04/259871/index.html

我该怎么做呢?

4

1 回答 1

0

当然,您可以像这样拆分网址:

RewriteRule ^(\d{4})(\d{2})(\d{2})(\d*)$ /$1/$2/$3/$4/index.html [L,R]

在我看来,PHP 方法将是更好的选择。

于 2012-04-09T12:49:27.627 回答