Forum

Thread tagged as: Configuration, Suggestions, Blog

Blog Post Preview Configuration W/ Clean URL's

I was trying to figure out why my blog post previews were not displaying correctly. I finally found the information I needed to fix the problem through really old posts in the forum. I believe the answer to the problem that multiple people have had should be included in the documentation here under "Preview URLs": https://docs.grabaperch.com/addons/blog/examples/clean-urls-perch/

The rewrite rules that fix the problem:

RewriteRule ^blog/([a-zA-Z0-9-/]+)/preview$ /blog/post.php?s=$1&preview=all [L]
RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]
Nick Santini

Nick Santini 0 points

  • 3 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, I'm not sure I follow. What's happening with it?

Ok so after implementing clean urls, when I would go to preview one of my blog post drafts the post would not actually show up. This is because the /preview url rewrite that needed to be added.

Based on old support threads there have been other people that ran into the same problem.

This is why I think that rewrite rule should be added to the Clean Urls page.

Hussein Al Hammad

Hussein Al Hammad 105 points
Registered Developer

The documentation already mentions what you should do for preview URLs:

Once URLs are rewritten, draft post preview is achieved by adding /preview to the end of your URL, so remember to add a rule for that. You should rewrite it to add the query string argument preview=all to the URL.

An example would probably make it easier to follow though.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so you're not actually having a problem at the moment?

I apologize for the confusion. Not at the moment. I had just fixed the problem when I started the thread.