Answer the question
In order to leave comments, you need to log in
How to add a slash at the end of pagination?
Good day to all!
There was the following problem in pagination, there is the following code structure:
In .htaccess
RewriteRule ^([0-9]+)_(.*)/$ list.php?cat=$1
RewriteRule ^([0-9]+)_(.*)/([0-9]+)/$ list.php?cat=$1&page=$3
$('body').on('click', '.pagination a', function(){
var ajxData = $('#ajaxLoading');
page = $(this).data('page');
$.ajax({
type: 'POST',
url: page+'/page/',
success: function(data) {
var content = $(data).find('#ajaxData').html();
$('#ajaxData').html(content);
}
});
});
RewriteRule ^([0-9]+)_(.*)/([0-9]+)/$ list.php?cat=$1&page=$3
RewriteRule ^([0-9]+)_(.*)/([0-9]+)$ list.php?cat=$1&page=$3
$page = (isset($_GET["page"]) AND intval($_GET["page"]) >= 1) ? intval($_GET["page"]) : 1;
Answer the question
In order to leave comments, you need to log in
RewriteRule ^([0-9]+)_(.*)/$ list.php?cat=$1
RewriteRule ^([0-9]+)_(.*)/([0-9]+)/$ list.php?cat=$1&page=$3
(.*)
means any number of any characters. ^([0-9]+)_(.*)/$
matches 123_text/
and 123_text/345/
. RewriteRule ^([0-9]+)_(.*)/([0-9]+)/$ list.php?cat=$1&page=$3
RewriteRule ^([0-9]+)_(.*)/$ list.php?cat=$1
RewriteRule ^([0-9]{1,})_(.+[^/])/([0-9]{1,})$ list.php\?cat\=$1&page\=$3
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question