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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T13:59:37+00:00 2026-06-07T13:59:37+00:00

I know that, wordpress redirects closely matched urls to its original url.However, I need

  • 0

I know that, wordpress redirects closely matched urls to its original url.However, I need to know the actual url at the very beginning of code execution. Is it possible?

1) If there is any method that takes a url as parameter and returns its original wordpress url
, that would be great, but not sure, whether it exists or not. Is there something like that?

2) where in the code actually does this test and redirection please?

3) Is there any hook that I can use to add a plugin to control this situation?

Thanks in advance.

Example:

Suppose, I have a post on this url: “http://mydomain.com/example-post-page”

Now if I try to access it via “http://mydomain.com/example-post-page/”, it will redirect you to original first url. It is true for other several small changes in url, all will redirect you to the actual permalink url.

My goal is to control this redirection. That’s why, when I am on “http://mydomain.com/example-post-page/” , I like to know(my code in on root index.php) whether this is the origianl permalink or is that something else, before it redirects.

  • 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-07T13:59:39+00:00Added an answer on June 7, 2026 at 1:59 pm

    Ok, At last I got it done in the following way and seems ok for me:

    1) Recieve approx url.
    2) Make a cURL request using this approx url.
    3) get response url.
    4) return the response url.

    Code given below:

    function get_actual_url($approx_url){
    $curlObj = curl_init();
    curl_setopt($curlObj, CURLOPT_URL, $approx_url);
    curl_setopt($curlObj, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curlObj, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($curlObj, CURLOPT_ENCODING , "gzip");
    curl_setopt($curlObj, CURLOPT_TIMEOUT,180);
    
    $content = curl_exec($curlObj);
    
    $info = curl_getinfo($curlObj);
    curl_close($curlObj);
    
    if(!empty($info) && !empty($info["url"])){
        return $info["url"];
    }
    else {
        return $approx_url;
    }}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to customize the date format in Wordpress. I know that minor date
I know that wordpress can be exported in the form of XML, but there
I know that Java have its own garbage collection, but sometimes I want to
We know that, we can set a permalink structure for wordpress from settings. But,
I'm so used to writing for Wordpress that I don't know how to do
We all know that wordpress have simple .htaccess code like below RewriteEngine on RewriteBase
I know that in Wordpress we can do the following: preg_match(/\p{Arabic}/u, get_the_title()) How can
I know that Wordpress allows us to create a new user and the user's
I know that Phonegap has an event for back button, but it's only available
I know that this sort of question has been asked here before, but still

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.