重写具有多个页面的网址

I'm trying to rewrite my urls on a page that has a pagination option and I'm unsure of what string to use because the one i'm currently using isn't working.

My document structure is below

  • blog-listing.php
  • htaccess
  • /blog/post.php
  • /css/
  • /js/
  • /images/

What's already in my htaccess file

RewriteEngine on
RewriteRule ^blog/category/([a-zA-Z0-9-/]+)$ /blog/archive.php?cat=$1 [L]
RewriteRule ^blog/category/([a-zA-Z0-9-/]+)/page/([0-9]+)/{0,1}$ /blog/archive.php?cat=$1&page=$2 [L]
RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1 [L]
RewriteRule ^blog/([a-zA-Z0-9-/]+)$ /blog/post.php?s=$1&page=$2 [L]

RewriteRule ^(css)($|/) - [L]
RewriteRule ^(perch)($|/) - [L]
RewriteRule ^(images)($|/) - [L]
RewriteRule ^(js)($|/) - [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

The line i've tried to use

RewriteRule ^blog-listing/([a-zA-Z0-9-/]+)$ /blog-listing.php?s=$1&page=$2 [L]

The url I'm receiving

http://mysite(dot)com/blog-listing.php?page=2

The url I'd like

http://mysite(dot)com/blog-listing/page-2

Any ideas?

Use a simple file to manage your url

RewriteEngine On

# Redirect all requests not pointing at an actual file to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L] 

https://github.com/ogallardop/blackjack-api/blob/master/src/.htaccess

The framework you're using to pagination will do the rest.