Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Htaccess RewriteRule Pagination
07-28-2011, 02:19 PM #1
- Join Date
- Mar 2010
- Thanked 5 Times in 5 Posts
Htaccess RewriteRule Pagination
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] </IfModule>