View Full Version : Htaccess RewriteRule Pagination

07-28-2011, 03:19 PM
Hi guys I made news blog with pagination.
Yesterday I decided i wanted to rewrite the urls to make them cleaner.
Now my normal url looks like this:


Note the start is for the pagination.

So I rewrote it to this:


This worked however sometimes the pagination is not included.
How should I modify the htaccess to also display the page when start is not set?

For example: site.com/blog.php?id=10
should become: site.com/blog/10/post_title/

My code so far:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^blog/([0-9]+)/[^/]+\/?paging-([0-9]?)$ blog.php?id=$1&start=$2 [L]
RewriteRule ^blog/?$ blog.php [L]