Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2010
    Posts
    140
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Pagination url rewrite in .htaccess

    I have a url rewrite rule in my .htaccess file.

    Code:
    RewriteRule ^nameofpage$ /file.php?var=1&var2=a&page=1 [L]
    The pagination script adds a variable page 1 or page 2. It works if i use the entire url without the .htaccess rewrite rule.

    Code:
    file.php?var=1&var2=a&page=1
    It does not work if i use this

    Code:
    nameofpage?page=1
    I would like to use the url above. As far as the rewrite rule, can it be changed to accommadate the pagination var?

  • #2
    Regular Coder
    Join Date
    May 2010
    Posts
    140
    Thanks
    7
    Thanked 0 Times in 0 Posts
    Nevermind I figured it out. Just added QSA in the brackets at the end of the Rewriterule like this [QSA, L]

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Yep, query string append. Glad you got it figured out.
    This doesn't belong in the PHP forum though, this is a rewrite issue, so moving to Apache Configuration forum.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •