Go Back   CodingForums.com > :: Server side development > Apache configuration

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-19-2012, 02:18 AM   PM User | #1
twobyfour
Regular Coder

 
Join Date: May 2010
Posts: 140
Thanks: 7
Thanked 0 Times in 0 Posts
twobyfour has a little shameless behaviour in the past
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?
twobyfour is offline   Reply With Quote
Old 03-19-2012, 03:02 AM   PM User | #2
twobyfour
Regular Coder

 
Join Date: May 2010
Posts: 140
Thanks: 7
Thanked 0 Times in 0 Posts
twobyfour has a little shameless behaviour in the past
Nevermind I figured it out. Just added QSA in the brackets at the end of the Rewriterule like this [QSA, L]
twobyfour is offline   Reply With Quote
Old 03-19-2012, 02:58 PM   PM User | #3
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
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.
Fou-Lu is offline   Reply With Quote
Reply

Bookmarks

Tags
.htaccess rewriterule php

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:59 AM.


Advertisement
Log in to turn off these ads.