htaccess动态网址重定向到静态网址

时间:2014-11-25 04:17:52

标签: .htaccess redirect

我搜索了我从动态网址到静态网址的特定htaccess重定向,但无法找到合适的网址。所以这就是问题。

我想重定向
www.example.com/directory/?year=2014&month=September
www.example.com/directory/?year=2014&month=October
www.example.com/directory/?year=2015&month=December
等等


www.example.com/directory/2014/September
www.example.com/directory/2014/October
www.example.com/directory/2015/December
等等

希望您肯定会帮助逐步完成流程及其工作原理。 提前致谢

1 个答案:

答案 0 :(得分:0)

您可以在/directory/.htaccess文件中执行此操作:

RewriteEngine on
RewriteRule ^(\d+)/(\w+)/?$ ?year=$1&month=$2 [L]