开发者

Complex .htaccess rule help

I'm struggling to write a .htaccess file.

I need to redirect addresses such as:

/archives/YYYY/MM/post-name

to

/blog/post-name

Any help would开发者_StackOverflow be appreciated!


Make sure your rewrite engine is on:

RewriteEngine on
RewriteRule ^/archives/([^/]*)/([^/]*)/([^/]*)/?$ /blog/$3 [L] 

You can narrow it down by using {0-9,4} for the year and {0-9,2} for the month.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜