问题
Currently, my website's archive page lists are displaying as:
example.com/2012/05
I would like to change the url structure to:
example.com/blog/2012/05
I've tried using Redirects in combination with rewrites but I am not sure that works well. I've also just tried to do a simple rewrite like
RewriteRule ^([0-9]+)/([0-9]+)/$ /blog/$1/$2 [L]
to capture /year/month urls and convert them but I am unsuccessful.
I know how to edit the archive navigation menu to prepend a blog/ before the rest of the url, but I can't get this rewrite to link to the page properly
It is not in a subfolder. Thank you in advance for your help.
回答1:
There is a real easy way to do this...
Under the SETTINGS > PERMALINKS, change
/%year%/%monthnum%/%postname%/
to
/blog/%year%/%monthnum%/%postname%/
Note that your homepage will not be on /blog/. If you wanted that you will need to create a page called 'Blog' and change your 'Posts page' under SETTINGS > READING, to the 'Blog' page you created. More on that here: http://codex.wordpress.org/Creating_a_Static_Front_Page
来源:https://stackoverflow.com/questions/10917371/rewrite-wordpress-blog-archive-url-structure