Monthly archives sent to home page
AnonymousJanuary 14, 2013 at 1:18 am #6604
I created a page to display annual and monthly archives. Annual archives works fine, but any monthly link send you to home page instead of myblog/2008/10
I have deactivated all plugins but the problem persist.
I have to say that recently changed the permalinks fromQuote:motus-anima.com/2013/01/sample-post/
and added a redirection code in htaccess file to redirect the old permalinks to the new ones.
Am I missing something here?
I have no clue what could be causing this.
The link to my site’s archives is this: http://motus-anima.com/archivos-motus-anima/.
Thanks in advance for any help you can give me!Admin
I’m almost certain that your permalink change is what causing the issue, especially with your new permalink structure.
You see, when you have a structure like you have (
motus-anima.com/sample-post/), more often than not WordPress won’t be able to tell whether what is being requested is a post, or a page, or an archive page, etc.
If I were you, I would not adopt that permalink structure. If you don’t want the date in your permalink, you can use categories, or even a custom prefix like so:Quote:motus-anima.com/the-awesome-category/sample-post/
AnonymousJanuary 14, 2013 at 6:36 pm #35040
I changed the permalink structure thinking that is easier to read. Following a guide I added this to htaccess to avoid loosing backlinks:
RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://motus-anima.com/$3
However, that redirection was the cause of messing the monthly archives. Searching for a fix, found this page: 10 awesome htaccess hacks for wordpress. The author also advice to use a redirection, but slightly different from the one I had.
RedirectMatch 301 /([0-9]+)/([0-9]+)/([0-9]+)/(.*)$ http://www.domain.com/$4
This one has a 4 at the end, instead of a 3 that I was using. To be honest with you, I have no idea what means that number, but that seems to fix the problem.
Do you think is worth to change the permalink structure?
Thanks for your support Syahir!AdminQuote:I changed the permalink structure thinking that is easier to read.
The benefit is marginal, if any. I would argue that it would be more user- and SEO-friendly to add some other type of hierarchy, like the post category, to the URL.
$4means that the 4th matched text in the regex
/([0-9]+)/([0-9]+)/([0-9]+)/(.*)$, so it is the last portion of the entered URL
If it works it works, but make sure you do a thorough test and ensure that there’s no broken links, especially with regard to single-post pagination, archive page pagination, etc. Easier to change the permalink now rather than later when your site has been thoroughly indexed and gained some PageRank.
AnonymousJanuary 15, 2013 at 1:41 am #35042Quote:Easier to change the permalink now rather than later when your site has been thoroughly indexed and gained some PageRank.
You’re right. There is a lot of work I have to do in the site; I’ll try to change the permalink to show the post category instead of just the name of the post.
Thanks for your advice!!
- You must be logged in to reply to this topic.