My problem has probably been asked, but all the ones I’ve been searching for on stackoverflow confuse me. I’m trying to make it so that when I do “www.website.com/newest/2” it goes to page 2, and when I do “www.website.com/newest/2/3” it goes to page 2 and the 3rd item. What is good is that the pages work. If I put “www.website.com/newest/2” it goes to the 2nd page, but anything after that, such as “www.website.com/newest/2/3” doesn’t work. It no longer goes on to the 3rd item. Only the pages load correctly, but posts numbers on pages after the page numbers don’t work. When I do “www.website.com/newest/2/3” I look in the browser’s source code and see that any code that was supposed to show that had to do with the GET request for the item number are not even in the code. That means that the GET requests for my item/id numbers are broken.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^website\.com$ [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [L,R=301]
RewriteRule ^newest/(.+)*/?$ ./index.php?newest=$1
RewriteRule ^newest/(.+)*/(.+)*/?$ ./index.php?newest=$1&id=$2
The problem is that your
(.+)*will match as many characters as it needs to make a match. Change them to(.+?)instead.