This is not exactly PHP but as it is so much related to Apache I considered this place the most suitable to post this question.
I want to create pagination with .htaccess so that this would be the appearance of the URL:
page 1 would be this way:
[url]http://www.mydomain.com/game/name-of-game-sef/review/
from page 2 on the URL would change a little:
[url]http://www.mydomain.com/game/name-of-game-sef/review/[B]2/
[url]http://www.mydomain.com/game/name-of-game-sef/review/[B]3/
…
[url]http://www.mydomain.com/game/name-of-game-sef/review/[B]n/
It might also be like this, if the review was specially made for an only platform (PS3, Xbox, etc):
[url]http://www.mydomain.com/game/sef-name-of-game/[B]ps3
These are the rules I created in order to manage these URL’s from Apache and redirect the request to the proper php file:
[CODE]# for pages from 2 on
RewriteRule ^game/([_0-9a-z-]+)/?([_0-9a-z-]+)?/review/([0-9]+)/ reviews.php?idgame=$1&idplatform=$2&page=$3 [L]
# for page 1
RewriteRule ^game/([_0-9a-z-]+)/?([_0-9a-z-]+)?/review/ reviews.php?idgame=$1&idplatform=$2&page=1 [L]
I’m not keen on regular expressions :rolleyes:, and only the first page can be displayed. When I click on page 2, 3, etc, it always displays the first one.
I’ve also tried testing it on a local machine with XAMPP, but in this case no matter what I do, even if I delete .htaccess, it returns a 301 error (Moved permanently) and I can’t access index.php
Could somebody please shed a light on this?? ?