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

  • SEARCH
  • Home
  • 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 9259403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:39:01+00:00 2026-06-18T12:39:01+00:00

I have an Express application that gets search parameters and page numbers via query

  • 0

I have an Express application that gets search parameters and page numbers via query strings.

var name = req.query.name;
var state = req.query.state;
var category = req.query.category;
var pageNum = req.query.pagenum;

What I want is if the search query has a page number and yields no results, to do a search without the page number and pass that back to the client. This works fine, and the front-end is receiving the data correctly.

The only thing is that I want the URL to reflect the changed page number search, so rather than being website.com/search?page=4&state=AL I’d like it to have the page number stripped or changed to 1. I can do this via Javascript on the front-end, but I’d rather have the url changed on the server side (it makes more sense to me at least, rather than having to change every template to do that).

EDIT:

Looks like the only way of doing this is to redirect to the URL without the page query string parameter. It seems this will help me out in getting this done.

  • 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-18T12:39:02+00:00Added an answer on June 18, 2026 at 12:39 pm

    I don’t quite know your environment, but generally URLs cannot be “changed” on server-side, because they are displayed in the browser on the client-side. The user sees the last whole page request’s url. You can only force an URL update (actually a page reload with different URL) from server-side with a HTTP redirect header.

    You could check if there are any results for the query with page number, and if not, simply send a redirect to the URL without the page number, so the user sees that extended result with its proper (page-less) URL.

    Hope it helps something.

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

Sidebar

Related Questions

I have a c# wpf application that requires SQL Express 2005 database and I
I have developed a C# 4.0 desktop application that uses a SQL Server Express
I am using Visual C# Express 2008 and I have an application that starts
I have a C# application that connects to a named SQL Express instance on
In my NodeJS express application I have app.js that has a few common routes.
I have a application that uses LocalDataCache to synchronise a SQL Server 2008 Express
I have a web application that uses a local SQL Server Express database (a.k.a.
I have an MVC 4 application that uses Entity-Framework and SQL Express 2008 ,
We have an application that uses SQL Server 2008 R2 Express with Advanced Services.
I have an application that uses linq-to-sql with Sql Server Express 2008. When I

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.