Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8048763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:34:53+00:00 2026-06-05T06:34:53+00:00

Possible Duplicate: Query Strings & Mod ReWrite I have written a .htaccess file which

  • 0

Possible Duplicate:
Query Strings & Mod ReWrite

I have written a .htaccess file which correctly translates the following line into

http://localhost/questions/32/new-question-from-peter

into

http://localhost/questions.php?question_id=32.

The code I use is

RewriteRule ^questions/([0-9]+)/[^/]*(?:\?(.+)=(.*))?$ public/questions.php?question_id=$1&$2=$3 [NC,L]

However when the url is the following,

http://localhost/questions/32/new-question-from-peter?page= <int>

it will not process the page information correctly even though when my url is

http://localhost/questions.php?question_id=32&page=2

it works perfectly.

Can someone help me with this please, where in my code have I gone wrong

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T06:34:54+00:00Added an answer on June 5, 2026 at 6:34 am

    You should use the QSA (Query String Append) flag, like this:

    RewriteRule ^questions/([0-9]+)/[^/]*/?$ public/questions.php?question_id=$1 [NC,L,QSA]
    

    The query string (&page=2) is handled automatically in this case, so you don’t need to deal with it in your regular expression, and is appended to the end of the rewritten URL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Concatenate many rows into a single text string? I have a query
Possible Duplicate: php/Mysql query with inserting date fails I have a datepicker code below:
Possible Duplicate: SQL Server Database query help Hi, I have a problem that I
Possible Duplicate: Writing an SQL query to SELECT item from the following table I
Possible Duplicate: regex for URL including query string I have a text or message.
Possible Duplicate: Parameterizing a SQL IN clause? Hi, I have a query looks like
Possible Duplicate: Get entire URL, including query string and anchor I have my url
Possible Duplicate: Parsing query strings in Java PHP has parse_str() , is there an
Possible Duplicate: Get query string values in JavaScript Parse query string in JavaScript http://www.example.org/search?q=example&another=test&again=more
Possible Duplicate: Get query string values in JavaScript Say if,i've a URL like this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.