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 8083721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:33:59+00:00 2026-06-05T17:33:59+00:00

I found this code on the internetz, it checks the current page url; function

  • 0

I found this code on the internetz, it checks the current page url;

function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}

So now I can do something like this;

elseif (curPageURL() == "http://www.example.com/pageexample") {
<meta tags here>
}

Great. But I would also like to use this for pagination pages. Those URLs look like this:

http://www.example.com/pageexample?start=30&groep=0
http://www.example.com/pageexample?start=60&groep=0
http://www.example.com/pageexample?start=90&groep=0
[....]
http://www.example.com/pageexample?start=270&groep=0

I could use a if statement for every of those links.. but I would much rather like to use one. Is it possible to add a wildcard or something? Like this I guess (notice the *)

elseif (curPageURL() == "http://www.example.com/pageexample" OR curPageURL() == "http://www.example.com/pageexample?start=*&groep=0") {

edit: I would like to do this for all those URLs because I want to give them the same meta description, <title> and <link rel="canonical". I could do this manually by doing an if-statement for every page (10+ atm) but I figured there was a better way.

  • 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-05T17:34:01+00:00Added an answer on June 5, 2026 at 5:34 pm

    Sounds a lot like regex problem:

    if (preg_match("#^http://www.example.com/pageexample(\?start=[^&]*&groep=0)?#", curPageURL())) {
        // it matches
    }
    

    The expression [^&]* acts like your *.; to match non-empty items, use[^&]+`. It matches these:

    http://www.example.com/pageexample
    http://www.example.com/pageexample?start=30&groep=0
    

    Update

    It’s not entirely clear why you need to compare against the full canonical URL, unless you have multiple domains point to the same code base.

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

Sidebar

Related Questions

I found this article about simple proxy server implemented in JAVA: http://www.java2s.com/Code/Java/Network-Protocol/Asimpleproxyserver.htm The code
I've got this code from an example I found useful around Internet. It uses
Hi i have problem with this code, i found it on the internet and
Watching some code found on internet I came across this piece of code: int
This is some code I found on the internet. I'm not sure how it
I found some mapkit code on the internet that looks like this: - (void)recenterMap
I found this code, it supposed to find the first cell in the visible
I found this code online that has a procedure inside a procedure. I cannot
I found this code online: def merge(left, right): result = [] i ,j =
I found this code in one of the other questions on here. It's exactly

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.