htaccess rule
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)_p([0-9]+).html$ $1.html?_pn=$2&%{QUERY_STRING}
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ index.php?param=$1&%{QUERY_STRING} [L,NC]
Input url – http://localhost/blabla/blablabla.html
Result
Array
(
[param] => blabla/blablabla
)
But for
Input url – http://localhost/blabla/blablabla_p2.html
Result
Array
(
[param] => blabla/blablabla.html/blabla/blablabla_p2
[_pn] => 2
)
What is this “/blabla/blablabla_p2”
But I need
Array
(
[param] => blabla/blablabla
[_pn] => 2
)
Put
[L]behind the firstRewriteRule.Otherwise, rewriting will continue and your newly rewritten URL from rule one is passed on to rule two.